Hi all,
We're working on an ASP.Net Web Application that makes several calls to a
SQL Server database. Everything was running correctly when the database
and the web server were on the same computer, but we have sinced moved
them to separate computers; IIS V6 on Win2000 and SQL Server 8(SP3) on Win
Serv 2003 Ent.
The connection string in our web.config file originally looked like this:
<add key="ConnectionString"
value=" server=localhost;Trusted_Connection=true
;database=Store;" />
After moving the database (and changing the server in the connection
string), we started to receive this error: "Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection."
We ended up changing the connection string to look like this:
<add key="ConnectionString" value="Integrated Security=SSPI;Initial
Catalog=Store;Data Source=192.168.0.12;" />
This string only works if we add the following to the .config file:
<authentication mode="Windows" />
<identity impersonate="true" />
Unfortunately, the web application was designed to use forms
authentication, so we're still looking for a valid connection string.
We've tried setting Trusted_Connection=false and providing a username and
password, but we get the same error as before - only with the provided
username listed instead of (null). We've tried setting the database to
mixed mode, and Win Auth only and got the same results.
Any help would be greatly appreciated.
Jason DeCock
Elk River Systems, Inc.
http://www.elkriversystems.comStandard SQL Authentication would not have Integrated Security in the
string. This implies we are requesting
NT authentication.
Your connection string should look something like this:
Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=SQLUserNameHere;Initial Catalog=Northwind;Data
Source=SQLServerNameHere,1433;Network Library=DBMSSOCN;Use Encryption for
Data=False
There's also some good documentation here;
http://msdn.microsoft.com/library/d...-us/dnnetsec/ht
ml/SecNetHT03.asp
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||I'm guessing you did a new install of SQL2k ... if I recall correctly, one
of the default Network Configurations includes NamedPipes as well as TCP/IP
... which in turn will lead to some issues with being able to use TCP/IP.
Try clearing NamedPipes.
This may also be a role/user access issue on the Win3 server.
"Big Mo" <jdecock@.gonzaga.nospam.edu> wrote in message
news:Pine.LNX.4.44.0406171221360.21793-100000@.barney.gonzaga.edu...
> Hi all,
> We're working on an ASP.Net Web Application that makes several calls to a
> SQL Server database. Everything was running correctly when the database
> and the web server were on the same computer, but we have sinced moved
> them to separate computers; IIS V6 on Win2000 and SQL Server 8(SP3) on Win
> Serv 2003 Ent.
> The connection string in our web.config file originally looked like this:
> <add key="ConnectionString"
> value=" server=localhost;Trusted_Connection=true
;database=Store;" />
> After moving the database (and changing the server in the connection
> string), we started to receive this error: "Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection."
> We ended up changing the connection string to look like this:
> <add key="ConnectionString" value="Integrated Security=SSPI;Initial
> Catalog=Store;Data Source=192.168.0.12;" />
> This string only works if we add the following to the .config file:
> <authentication mode="Windows" />
> <identity impersonate="true" />
> Unfortunately, the web application was designed to use forms
> authentication, so we're still looking for a valid connection string.
> We've tried setting Trusted_Connection=false and providing a username and
> password, but we get the same error as before - only with the provided
> username listed instead of (null). We've tried setting the database to
> mixed mode, and Win Auth only and got the same results.
> Any help would be greatly appreciated.
>
> --
> Jason DeCock
> Elk River Systems, Inc.
> http://www.elkriversystems.com
>|||One way out would be
- configure your iis asp.net worker process to run under a domain account
(need to modify your machine.config file)
- add this domain account as a valid login to your sql server.
hth
vikram
"Big Mo" <jdecock@.gonzaga.nospam.edu> wrote in message
news:Pine.LNX.4.44.0406171221360.21793-100000@.barney.gonzaga.edu...
> Hi all,
> We're working on an ASP.Net Web Application that makes several calls to a
> SQL Server database. Everything was running correctly when the database
> and the web server were on the same computer, but we have sinced moved
> them to separate computers; IIS V6 on Win2000 and SQL Server 8(SP3) on Win
> Serv 2003 Ent.
> The connection string in our web.config file originally looked like this:
> <add key="ConnectionString"
> value=" server=localhost;Trusted_Connection=true
;database=Store;" />
> After moving the database (and changing the server in the connection
> string), we started to receive this error: "Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection."
> We ended up changing the connection string to look like this:
> <add key="ConnectionString" value="Integrated Security=SSPI;Initial
> Catalog=Store;Data Source=192.168.0.12;" />
> This string only works if we add the following to the .config file:
> <authentication mode="Windows" />
> <identity impersonate="true" />
> Unfortunately, the web application was designed to use forms
> authentication, so we're still looking for a valid connection string.
> We've tried setting Trusted_Connection=false and providing a username and
> password, but we get the same error as before - only with the provided
> username listed instead of (null). We've tried setting the database to
> mixed mode, and Win Auth only and got the same results.
> Any help would be greatly appreciated.
>
> --
> Jason DeCock
> Elk River Systems, Inc.
> http://www.elkriversystems.com
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment