p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: (null) user name


Message #1 by jim@f... on Fri, 7 Mar 2003 17:09:06
I have a vb.net Web application that is attempting to access a MSSql 2000 
database.  When I do, I get an error as follows:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL 
Server connection.

There are hundreds of posts that refer to this all centered around 
Windows/Sql authentication.  

The problem I have is the null user.  No matter what I do, (ie changing 
the default website properties) I get a null user.  

How can I get a user name out of IIS so Sql will work properly?

Jim
Message #2 by "Mark Hartshorn" <mark.mch1@n...> on Fri, 7 Mar 2003 21:59:56
> I have a vb.net Web application that is attempting to access a MSSql 
2000 
d> atabase.  When I do, I get an error as follows:

> Login failed for user '(null)'. Reason: Not associated with a trusted 
SQL 
S> erver connection.

> There are hundreds of posts that refer to this all centered around 
W> indows/Sql authentication.  

> The problem I have is the null user.  No matter what I do, (ie changing 
t> he default website properties) I get a null user.  

> How can I get a user name out of IIS so Sql will work properly?

> Jim
Message #3 by "Mark Hartshorn" <mark.mch1@n...> on Fri, 7 Mar 2003 22:04:47
Try again 

Jim, Hi

This is down to 2 possible issues.

1) All ASP.Net code running under default run as/login etc will run under 
the user ASPNET.  Therefore this user will require the relevent 
privallages on the IIS machine.

2) Depending on the Authentication setting within SQL Server the above 
user may need to be setup within SQL server for Windows authentication 
(default setting i believe) although the better (and recommended) way is 
to set SQL server authetication to mixed mode.

Hope this helps

Mark
Message #4 by "Jerry Lanphear" <jerrylan@q...> on Fri, 7 Mar 2003 15:29:42 -0700
The other possibility is that ASP.NET is running on a Domain Controller
which requires a different and possibly risky (security) setup.

----- Original Message -----
From: "Mark Hartshorn" <mark.mch1@n...>
To: "Website Programming with ASP.NET"
<aspdotnet_website_programming@p...>
Sent: Friday, March 07, 2003 10:04 PM
Subject: [aspdotnet_website_programming] Re: (null) user name


> Try again
>
> Jim, Hi
>
> This is down to 2 possible issues.
>
> 1) All ASP.Net code running under default run as/login etc will run under
> the user ASPNET.  Therefore this user will require the relevent
> privallages on the IIS machine.
>
> 2) Depending on the Authentication setting within SQL Server the above
> user may need to be setup within SQL server for Windows authentication
> (default setting i believe) although the better (and recommended) way is
> to set SQL server authetication to mixed mode.
>
> Hope this helps
>
> Mark
> ---
> Professional Design Patterns in VB.NET:
> Building Adaptable Applications
>
> Want to know how design patterns bring reusable
> design and adaptabilty to your applications? How
> to recognize the need for a design pattern
> solution? How to select, design, and implement
> the right patterns? How parts of the .NET Framework
> (like the .NET Data Providers and .NET Remoting)
> take advantage of design patterns? This book
> presents a practical approach to using design
> patterns in VB.NET, by focusing on the relevance
> of design patterns in the different tiers of a
> distributed n-tier architecture.
>
> http://www.wrox.com/books/1861006985.htm
>
>
>

Message #5 by jim@f... on Tue, 11 Mar 2003 15:02:29
> Try again 

> Jim, Hi

> This is down to 2 possible issues.

> 1) All ASP.Net code running under default run as/login etc will run 
under 
t> he user ASPNET.  Therefore this user will require the relevent 
p> rivallages on the IIS machine.

> 2) Depending on the Authentication setting within SQL Server the above 
u> ser may need to be setup within SQL server for Windows authentication 
(> default setting i believe) although the better (and recommended) way is 
t> o set SQL server authetication to mixed mode.

> Hope this helps

> Mark


Mark:

Is the ASPNET user a domain user or a local user.  Do I set the relevent 
privaleges under NT permissions, or IIS Permissions?

Thanks for your help.

Jim
Message #6 by "Mark Hartshorn" <mark.mch1@n...> on Thu, 13 Mar 2003 00:54:07
Jim, Hi

ASPNET user is a local user which runs the .net asp code both in Visual 
Studio and (i believe) compiled .net code under IIS.  As to whether you 
should use this user name in a live IIS machine is another matter and 
something which i havent come across yet.

You should move ASPNET into the Administrator group under NT permissions 
(again this is for development only)

Mark

  Return to Index