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

From: Jediah L. (rife_at_nospam.nospam)
Date: 09/01/04


Date: Tue, 31 Aug 2004 23:32:16 -0400

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" <dcgringo@visiontechnology.net> wrote in message
news:eSnPgu8jEHA.3456@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
>
>



Relevant Pages