Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2005, 11:40 AM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Different servers for IIS and SQL

Hi, I have been trying to deploy an ASPNET application. What I have done so far is:
1. Created the virtual Directory, and setup the directory security without anonymous access and with Integrated Windows security.
2. The ASP web.config file is also configured to Authentication = "Windows", authorization = "*" and impersonate = "true".
3. IIS and SQL server doesn't allow normal users logon, only with administrator privileges.
4. The Framework is already installed on the IIS
5. SQL has mixed security (Windows and SQL), I have already tried to run any Stored procedure from Query Analizer using my account and it works
6. If I try to run any aspx page that doesn't use database it works, but whenever I try to access to a page that runs stored procedures this error appear:

Object reference not set to an instance of an object

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   HelpDesk.DataAccess.Parameters.FillTable(String sp_name, String TechId) +634
   HelpDesk.DataAccess.Parameters.LoadAvailableTecnic ians() +19
   HelpDesk.ParameterSystem.ParameterSystem.IsTechnic ian(String username) +51
   WebUI._Default1.Page_Load(Object sender, EventArgs e) +41
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731

Please help me

ganzoategui
 
Old January 31st, 2005, 12:41 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

your code please!

 
Old January 31st, 2005, 01:31 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm attaching the web.config file because the application was working very well under develping environment (having all, Visual Studio .NET, IIS and SQL Server in my desktop), this error came up when I put it to propduction servers.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
        <section name="MyConfig" type="HelpDesk.Framework.AppConfiguration,HelpDesk .Framework"/>
  </configSections>

  <system.web>

    <!-- DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP.NET files.
    -->
    <compilation defaultLanguage="vb" debug="true" />

    <!-- CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
          Add <error> tags for each of the errors you want to handle.

          "On" Always display custom (friendly) messages.
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users not running
           on the local Web server. This setting is recommended for security purposes, so
           that you do not display application detail information to remote clients.
    -->
    <customErrors mode="Off" />

    <!-- AUTHENTICATION
          This section sets the authentication policies of the application. Possible modes are "Windows",
          "Forms", "Passport" and "None"

          "None" No authentication is performed.
          "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
           its settings for the application. Anonymous access must be disabled in IIS.
          "Forms" You provide a custom form (Web page) for users to enter their credentials, and then
           you authenticate them in your application. A user credential token is stored in a cookie.
          "Passport" Authentication is performed via a centralized authentication service provided
           by Microsoft that offers a single logon and core profile services for member sites.
    -->
    <authentication mode="Windows" />


    <!-- AUTHORIZATION
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
          (unauthenticated) users.
    -->
    <authorization>
        <allow users="*" />

            <!-- <allow users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>
    <identity impersonate ="true"/>

    <!-- APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every page within an application.
          Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
          trace information will be displayed at the bottom of each page. Otherwise, you can view the
          application trace log by browsing the "trace.axd" page from your web application
          root.
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />


    <!-- SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests belong to a particular session.
          If cookies are not available, a session can be tracked by adding a session identifier to the URL.
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false"
            timeout="20"
    />

    <!-- GLOBALIZATION
          This section sets the globalization settings of the application.
    -->
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

  </system.web>

  <MyConfig>
<add key="HDString" value="data source=SCVS0003; initial catalog=HelpDesk; integrated security=SSPI persist security info=False; Trusted_Connection=Yes"/>
<!-- <add key="HDString" value="data source=sclx0004;persist security info=True;initial catalog=HDesk;integrated security=SSPI"/>
-->

  </MyConfig>

</configuration>


 
Old February 1st, 2005, 06:00 PM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

This is a problem related to SQL SERVER login. Since your IIS & SQL Server are on different machines so when your ASP.NET application is trying to connect to the SqlServer it is using ASPNET/<MACHINE_NAME> account, which is not an authorized Login in your Sql Server. That's why you are getting the error. to solve this type of problem you can use Sql Server login in the connection string, or you can configure your asp.net application to run on a Service account that has got access privs to the Sql Server as well as visible to IIS.

Hope It Helps !!
Bhaskar Ghosh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Deployment to Shared Servers; SQL Script englere BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 May 17th, 2008 07:00 AM
finding sql servers with sqldmo BobS56 Pro VB Databases 0 December 15th, 2007 08:55 AM
Using linked SQL servers data in Access Irina_Ivanova Access 1 June 21st, 2007 05:12 PM
SQL XML Support in IIS jwa2vive SQL Server 2000 1 November 9th, 2005 01:10 PM
SQL Server and IIS 6.0 julesmel Classic ASP Databases 0 June 26th, 2003 05:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.