Previous Next

Thread: SQL Security using .NET Applications

Last post 07-04-2008 12:16 PM by steve schofield. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 07-03-2008, 6:35 PM

    SQL Security using .NET Applications

     Hi,

     I'm from Argentina. I'm running a ASP.NET Service Application and I'm getting the following error:

    "Object reference not set to an instance of an object"

    I read that I have to add the ASPNET User to the SQL database and that in Win Server 2003 it is called NT AUTHORITY\NETWORK SERVICE.... Is this correct?

     Any other idea? I'm sure this have someting to do with IIS and SQL permissions/configuration.



    Thanks !! 

  • 07-03-2008, 10:59 PM In reply to

    Re: SQL Security using .NET Applications

    If you are using network service to authenticate to sql, the actual 'account' is the machine account.  You need to grant permissions in sql to this account.  So if your webserver name is Web1, in Active Directory there is a account called Web1$ you need to grant permissions in SQL.

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 07-04-2008, 11:07 AM In reply to

    Re: SQL Security using .NET Applications

     Thanks Steve for your answer. I'm not actually using Active Directory, is it really necessary to use?

    What's your opinion about this error I'm getting? 

  • 07-04-2008, 12:16 PM In reply to

    Re: SQL Security using .NET Applications

    Does the code reside on a unc share?  If so, then the local server is having a problem accessing it across the network causing the error.  Here is a article I wrote on setting up a unc share access.  Since you don't have AD, then you'll need to have a local user with the same password on both boxes.

    http://www.iislogs.com/articles/23/

    Hope that helps.

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
Page 1 of 1 (4 items)
Page view counter