473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by .NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G
Jul 21 '05 #1
10 4715
This is my uninformed understanding - I could be completely wrong about
this! :-)

Seems to me that ASP.NET is running as Server1\ASPNET which is an account
local to the webserver. It's access token probably only has "anonymous"
rights to network resources, which isn't sufficient to login to SQL Server
on the remote box. The ASPNET account you have on server2, is
Server2\ASPNET, which isn't the same.

Cheers
Ken
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:eS**************@TK2MSFTNGP12.phx.gbl...
Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by
.NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result
with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist
security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G

Jul 21 '05 #2
DC,

Are you in an AD realm? If not - you will not be able to hop your
identities across the machines, but still have a few other options.

(its been a while since i've tackled the problem - but i'll do my best from
memory).

1: You can enable Basic Authentication instead of NTLM - while this is not
very secure - it will allow your credentials you supplied to the web site to
be passed (clear text) to the server which contains the sql database - just
grant the authenticated account access to the DB.

2. Setup impersonation on your web site, using the Identity node in the
web.config - keep NTLM on your site, and grant your identity that you
impersonate access to the database (this also requires additional setup to
the asp.net processModel - or elevating the ASPNET account to be able to do
identity impersonation), if you are in an AD realm you can let the web
application impersonate the NTLM user - otherwise you can specificy a
specific proxy account in the identity node - and encrypt it using the
aspnet_setreg.exe.

3. I find it unlikely that syncing your passwords would work in any
scanrio - while this would have worked back in NT - I don't believe windows
is still dumb enough to fall for it.
This should give you enough information to poke around and get it right.

Good Luck!

"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:eS**************@TK2MSFTNGP12.phx.gbl...
Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by
.NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result
with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist
security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G

Jul 21 '05 #3

The webserver ASPNET account may not be properly mapped with Server2(SQL).
Just delete the ASPNET acocunt in sql server, and create a Nt Account like
Server1\AspNet (Not a SQL serve account).

if nothing is working create a new Account in Webserver and assign to Worker
process account and refer the same account in Sql Server too.

Regards,
Govind.
"DC Gringo" wrote:
Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by .NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G

Jul 21 '05 #4
The most common answer is to run your web app under a domain account and
give that domain account access to SQL Server.

I have tried to use this "mapping of a local account" before. It only works
if both the account name and the password are the same on both machines.
Since the ASPNET account's password is managed by IIS, and changed on a
regular basis, it would be an unusual event to sync the ASPNET account.

Good Luck
--- Nick

"Govind" <Go****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...

The webserver ASPNET account may not be properly mapped with Server2(SQL).
Just delete the ASPNET acocunt in sql server, and create a Nt Account like
Server1\AspNet (Not a SQL serve account).

if nothing is working create a new Account in Webserver and assign to Worker process account and refer the same account in Sql Server too.

Regards,
Govind.
"DC Gringo" wrote:
Using latest SP Win2k and .NET versions, I have a .NET application running on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by ..NET Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result with Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist security info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G

Jul 21 '05 #5
On Tue, 31 Aug 2004 22:30:17 -0400, "DC Gringo"
<dc******@visiontechnology.net> wrote:
Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by .NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

I still get: Login failed for user '(null)'. Reason: Not associated with a
trusted SQL Server connection.
Might look at:

PRB: ASP/ODBC/SQL Server Error 0x80040E4D "Login Failed for User
'(Null)'":
http://support.microsoft.com/default...b;en-us;307002

Jeff


IIS is set to Windows Integrated Authentication...although same result with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>


Jul 21 '05 #6
Nick,

I have been using the "mapping of a local account" without a problem for
quite awhile now. Why do you say that they ASPNET account's password would
be changed on a regular basis?

I have manually set the ASPNET account's password on our web server and
hardcoded it (in clear text) in the machine.config (granted this may not be
the most secure thing), but why would IIS ever change it?

I have also created a local ASPNET user on our SQL box with matching
password. Works fine.

I chose not to go with a domain account simply because I did not fully
understand (and still don't) what all permissions I would need to apply to
that account on our webserver to mimick the default ASPNET user.

Greg
"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:JFeZc.103692$mD.57229@attbi_s02...
The most common answer is to run your web app under a domain account and
give that domain account access to SQL Server.

I have tried to use this "mapping of a local account" before. It only works if both the account name and the password are the same on both machines.
Since the ASPNET account's password is managed by IIS, and changed on a
regular basis, it would be an unusual event to sync the ASPNET account.

Good Luck
--- Nick

"Govind" <Go****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...

The webserver ASPNET account may not be properly mapped with Server2(SQL).
Just delete the ASPNET acocunt in sql server, and create a Nt Account like Server1\AspNet (Not a SQL serve account).

if nothing is working create a new Account in Webserver and assign to

Worker
process account and refer the same account in Sql Server too.

Regards,
Govind.
"DC Gringo" wrote:
Using latest SP Win2k and .NET versions, I have a .NET application

running on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by .NET Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has access to the database.

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

IIS is set to Windows Integrated Authentication...although same result with Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet size=4096;integrated security=SSPI;data source=""myserver"";persist security info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G


Jul 21 '05 #7
"Synching passwords" (aka pass-through authentication) worked before we went
to AD and continues to work in mixed-mode AD for us.

Here is link on the subject, all this one doesn't mention pass-through.
Cannot find the msdn article that did. :(
http://msdn.microsoft.com/library/de...pplication.asp

I am not using a domain account simply because I wasn't sure what
permissions to assign to it on the web server to mimick the default ASPNET
user. I just found this link, with which I might revisit the problem:

http://msdn.microsoft.com/library/de...lListsACLs.asp

Greg

"Jediah L." <ri**@nospam.nospam> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
DC,

Are you in an AD realm? If not - you will not be able to hop your
identities across the machines, but still have a few other options.

(its been a while since i've tackled the problem - but i'll do my best from memory).

1: You can enable Basic Authentication instead of NTLM - while this is not
very secure - it will allow your credentials you supplied to the web site to be passed (clear text) to the server which contains the sql database - just grant the authenticated account access to the DB.

2. Setup impersonation on your web site, using the Identity node in the
web.config - keep NTLM on your site, and grant your identity that you
impersonate access to the database (this also requires additional setup to
the asp.net processModel - or elevating the ASPNET account to be able to do identity impersonation), if you are in an AD realm you can let the web
application impersonate the NTLM user - otherwise you can specificy a
specific proxy account in the identity node - and encrypt it using the
aspnet_setreg.exe.

3. I find it unlikely that syncing your passwords would work in any
scanrio - while this would have worked back in NT - I don't believe windows is still dumb enough to fall for it.
This should give you enough information to poke around and get it right.

Good Luck!

"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:eS**************@TK2MSFTNGP12.phx.gbl...
Using latest SP Win2k and .NET versions, I have a .NET application running on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by
.NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result
with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist
security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G


Jul 21 '05 #8
I misspoke and I offer my apologies. ASPNET password is not known to the
end user, but it is not managed by IIS either.
You do have to change it so that you will know what it is.

You do agree, though, that the username and password for the local accounts
must be the same on both machines, yes?

The correct steps for creating a local account to run ASP.NET are described
here:
http://msdn.microsoft.com/library/de...l/secmod15.asp
Including all the details of what privileges are required at a minimum.

A good blog that provides a FAQ for ASP NET security is:
http://blogs.bartdesmet.net/bart/arc...004/07/31.aspx

HTH,
--- Nick

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nick,

I have been using the "mapping of a local account" without a problem for
quite awhile now. Why do you say that they ASPNET account's password would be changed on a regular basis?

I have manually set the ASPNET account's password on our web server and
hardcoded it (in clear text) in the machine.config (granted this may not be the most secure thing), but why would IIS ever change it?

I have also created a local ASPNET user on our SQL box with matching
password. Works fine.

I chose not to go with a domain account simply because I did not fully
understand (and still don't) what all permissions I would need to apply to
that account on our webserver to mimick the default ASPNET user.

Greg
"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:JFeZc.103692$mD.57229@attbi_s02...
The most common answer is to run your web app under a domain account and
give that domain account access to SQL Server.

I have tried to use this "mapping of a local account" before. It only

works
if both the account name and the password are the same on both machines.
Since the ASPNET account's password is managed by IIS, and changed on a
regular basis, it would be an unusual event to sync the ASPNET account.

Good Luck
--- Nick

"Govind" <Go****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...

The webserver ASPNET account may not be properly mapped with Server2(SQL). Just delete the ASPNET acocunt in sql server, and create a Nt Account like Server1\AspNet (Not a SQL serve account).

if nothing is working create a new Account in Webserver and assign to

Worker
process account and refer the same account in Sql Server too.

Regards,
Govind.
"DC Gringo" wrote:

> Using latest SP Win2k and .NET versions, I have a .NET application

running
> on server1 with a SQL Server database running on server2. I have the > Windows user account passwords sync'd for server1\aspnet (installed by
.NET
> Framework and server2\aspnet (created by me--this machine has no
..NET > Framework on it). The aspnet user on the database server (server2) has > access to the database.
>
> I still get: Login failed for user '(null)'. Reason: Not associated

with a
> trusted SQL Server connection.
>
> IIS is set to Windows Integrated Authentication...although same
result with
> Anonymous, with and without IIS controlling password that I enter.
>
> -----------------------------------
> Here's my connection string:
>
> Me.SqlConnection1.ConnectionString = "workstation

id=""CIL-094"";packet > size=4096;integrated security=SSPI;data source=""myserver"";persist

security
> info=False;initial catalog=mydb;"
>
>
> -----------------------------------
> Here's my web.config:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.web>
>
> <compilation defaultLanguage="vb" debug="true" />
> <customErrors mode="Off" >
> <error statusCode="404" redirect="~/errors/missingPage.aspx" />
> </customErrors>
> <authentication mode="Windows" />
>
> <authorization>
> <allow users="*" /> </authorization>
>
> <trace enabled="true" requestLimit="10" pageOutput="true"
> traceMode="SortByTime" localOnly="true"/>
>
> <sessionState
> mode="InProc"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data source=127.0.0.1;"
> cookieless="false"
> timeout="20"
> />
>
> <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
> </system.web>
> </configuration>
>
> --
> _____
> DC G
>
>
>



Jul 21 '05 #9
> You do agree, though, that the username and password for the local
accounts
must be the same on both machines, yes?
Most definately.
http://msdn.microsoft.com/library/de...l/secmod15.asp Great link!

Thanks,
Greg

"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:DNDZc.276086$eM2.75113@attbi_s51...I misspoke and I offer my apologies. ASPNET password is not known to the
end user, but it is not managed by IIS either.
You do have to change it so that you will know what it is.

You do agree, though, that the username and password for the local
accounts
must be the same on both machines, yes?

The correct steps for creating a local account to run ASP.NET are
described
here:
http://msdn.microsoft.com/library/de...l/secmod15.asp
Including all the details of what privileges are required at a minimum.

A good blog that provides a FAQ for ASP NET security is:
http://blogs.bartdesmet.net/bart/arc...004/07/31.aspx

HTH,
--- Nick

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nick,

I have been using the "mapping of a local account" without a problem for
quite awhile now. Why do you say that they ASPNET account's password

would
be changed on a regular basis?

I have manually set the ASPNET account's password on our web server and
hardcoded it (in clear text) in the machine.config (granted this may not

be
the most secure thing), but why would IIS ever change it?

I have also created a local ASPNET user on our SQL box with matching
password. Works fine.

I chose not to go with a domain account simply because I did not fully
understand (and still don't) what all permissions I would need to apply
to
that account on our webserver to mimick the default ASPNET user.

Greg
"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:JFeZc.103692$mD.57229@attbi_s02...
> The most common answer is to run your web app under a domain account
> and
> give that domain account access to SQL Server.
>
> I have tried to use this "mapping of a local account" before. It only

works
> if both the account name and the password are the same on both
> machines.
> Since the ASPNET account's password is managed by IIS, and changed on a
> regular basis, it would be an unusual event to sync the ASPNET account.
>
> Good Luck
> --- Nick
>
> "Govind" <Go****@discussions.microsoft.com> wrote in message
> news:AD**********************************@microsof t.com...
> >
> > The webserver ASPNET account may not be properly mapped with

Server2(SQL).
> > Just delete the ASPNET acocunt in sql server, and create a Nt Account

like
> > Server1\AspNet (Not a SQL serve account).
> >
> > if nothing is working create a new Account in Webserver and assign to
> Worker
> > process account and refer the same account in Sql Server too.
> >
> > Regards,
> > Govind.
> >
> >
> > "DC Gringo" wrote:
> >
> > > Using latest SP Win2k and .NET versions, I have a .NET application
> running
> > > on server1 with a SQL Server database running on server2. I have the > > > Windows user account passwords sync'd for server1\aspnet (installed by > .NET
> > > Framework and server2\aspnet (created by me--this machine has no .NET > > > Framework on it). The aspnet user on the database server (server2)

has
> > > access to the database.
> > >
> > > I still get: Login failed for user '(null)'. Reason: Not
> > > associated
> with a
> > > trusted SQL Server connection.
> > >
> > > IIS is set to Windows Integrated Authentication...although same result > with
> > > Anonymous, with and without IIS controlling password that I enter.
> > >
> > > -----------------------------------
> > > Here's my connection string:
> > >
> > > Me.SqlConnection1.ConnectionString = "workstation

id=""CIL-094"";packet
> > > size=4096;integrated security=SSPI;data source=""myserver"";persist
> security
> > > info=False;initial catalog=mydb;"
> > >
> > >
> > > -----------------------------------
> > > Here's my web.config:
> > >
> > > <?xml version="1.0" encoding="utf-8" ?>
> > > <configuration>
> > > <system.web>
> > >
> > > <compilation defaultLanguage="vb" debug="true" />
> > > <customErrors mode="Off" >
> > > <error statusCode="404" redirect="~/errors/missingPage.aspx" />
> > > </customErrors>
> > > <authentication mode="Windows" />
> > >
> > > <authorization>
> > > <allow users="*" /> </authorization>
> > >
> > > <trace enabled="true" requestLimit="10" pageOutput="true"
> > > traceMode="SortByTime" localOnly="true"/>
> > >
> > > <sessionState
> > > mode="InProc"
> > > stateConnectionString="tcpip=127.0.0.1:42424"
> > > sqlConnectionString="data source=127.0.0.1;"
> > > cookieless="false"
> > > timeout="20"
> > > />
> > >
> > > <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
> > > </system.web>
> > > </configuration>
> > >
> > > --
> > > _____
> > > DC G
> > >
> > >
> > >
>
>



Jul 21 '05 #10
Joe
If the AD group is not configured properly for access on the SQL server then
you could get this problem. For instance, if the ad group has system
administrator access at root level, but not for individual databases.

"DC Gringo" wrote:
Using latest SP Win2k and .NET versions, I have a .NET application running
on server1 with a SQL Server database running on server2. I have the
Windows user account passwords sync'd for server1\aspnet (installed by .NET
Framework and server2\aspnet (created by me--this machine has no .NET
Framework on it). The aspnet user on the database server (server2) has
access to the database.

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

IIS is set to Windows Integrated Authentication...although same result with
Anonymous, with and without IIS controlling password that I enter.

-----------------------------------
Here's my connection string:

Me.SqlConnection1.ConnectionString = "workstation id=""CIL-094"";packet
size=4096;integrated security=SSPI;data source=""myserver"";persist security
info=False;initial catalog=mydb;"
-----------------------------------
Here's my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" >
<error statusCode="404" redirect="~/errors/missingPage.aspx" />
</customErrors>
<authentication mode="Windows" />

<authorization>
<allow users="*" /> </authorization>

<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

--
_____
DC G

Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TBone | last post by:
Anyone, I have a user "john" whose machine is part of the "job" domain. He is trying to establish an odbc connection to an MS SQL 2000 server on the "school" domain. He uses Windows...
1
by: Mark | last post by:
We are using impersonation so that a user on our domain will login into our SQL Server using their own domain login and/or associated domain groups. To do this, we've added: <authentication...
0
by: Frederik | last post by:
Bonjour , J'ai développé une petite application web sur winxp IIS5.0 avec Sql Server Developper edition. Tout fonctionne parfaitement. Par contre ca ne fonctionne pas lorsque je fais rouler l'app...
2
by: Frederik | last post by:
Hi, First sorry for my english I'm french. I developped a web app that work good under XPDEVSERVER machine (iis5) and SqlServerDevelopper Edition. I get problem when I moved this app to an...
4
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet...
1
by: jerminator | last post by:
Ok I need some help. Up until Tuesday my application was working fine. It is an asp.net application written in VB. It is very data heavy and makes multiple calls to a database. The application...
1
by: tleper | last post by:
hi, there are two win2003 servers in the same workgroup. one has mssql 2000 server and other one has asp.net 2.0 web application connecting that mssql server. mssql server Authentication is SQL...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.