473,840 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

There are loads of post on this, but nothing that seems to cover my
exact problem ;)

I have an ASP.Net 1.1 web application running on my local machine. I
want to connect to an SQL 2005 server running on Windows 2003.

If I use SQL authentication, all is fine and dandy. If I want to use
windows authentication it gives the above error. My SQL server is set
to allow both methods (first thing I checked) and is part of the
domain (2nd thing checked).

If I create a UDL file on the local machine and connect to the SQL
server with that, it reports that the test connection is successful,
so I took the connection string from that and used it in my
web.config, but got the above error.

Here's my connection string using SQL Authentication

"Password=RagUs er;Persist Security Info=True;User ID=RagUser;Init ial
Catalog=KBDL_Co nfig;Data Source=UKBOLDEV 01"

and the connection string using windows authentication

"Integrated Security=SSPI;P ersist Security Info=False;Init ial
Catalog=KBDL_Co nfig;Data Source=ukboldev 01"

Even adding 'Trusted Connection=True ' to the windows authentication
doesn't help!

SQL 2005 has errors in it's log, it shows.

10/26/2007 16:35:54,Logon, Unknown,Login failed for user ''. The user
is not associated with a trusted SQL Server connection. [CLIENT:
192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 18452<c/Severity: 14<c/>
State: 1.
10/26/2007 16:35:54,Logon, Unknown,SSPI handshake failed with error
code 0x8009030c while establishing a connection with integrated
security; the connection has been closed. [CLIENT: 192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 17806<c/Severity: 20<c/>
State: 2.
I'm baffled by this, I've even tried connecting to the server using
oSQL, that was successful, but with vb.net from a web app, it fails.
There's a code snippet below

<code>
strSQL = "SELECT * FROM LOGINS WHERE Username='" & strUsername & "'
AND Password='" & strPassword & "'"

myconnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs("ConfigCon") ) 'get
from web.config
myCommand = New SqlCommand(strS QL, myconnection)

Try
If (myCommand.Conn ection.State <ConnectionStat e.Open)
Then 'check connection state
myCommand.Conne ction.Open() ' open connection if
needed
End If
</code>

Oct 26 '07 #1
4 12101
Have you tried also something such as :
http://msdn2.microsoft.com/en-us/library/ms998320.aspx
--
Patrice

"eruth" <em***********@ gmail.coma écrit dans le message de news:
11************* *******@k79g200 0h...legrou ps.com...
There are loads of post on this, but nothing that seems to cover my
exact problem ;)

I have an ASP.Net 1.1 web application running on my local machine. I
want to connect to an SQL 2005 server running on Windows 2003.

If I use SQL authentication, all is fine and dandy. If I want to use
windows authentication it gives the above error. My SQL server is set
to allow both methods (first thing I checked) and is part of the
domain (2nd thing checked).

If I create a UDL file on the local machine and connect to the SQL
server with that, it reports that the test connection is successful,
so I took the connection string from that and used it in my
web.config, but got the above error.

Here's my connection string using SQL Authentication

"Password=RagUs er;Persist Security Info=True;User ID=RagUser;Init ial
Catalog=KBDL_Co nfig;Data Source=UKBOLDEV 01"

and the connection string using windows authentication

"Integrated Security=SSPI;P ersist Security Info=False;Init ial
Catalog=KBDL_Co nfig;Data Source=ukboldev 01"

Even adding 'Trusted Connection=True ' to the windows authentication
doesn't help!

SQL 2005 has errors in it's log, it shows.

10/26/2007 16:35:54,Logon, Unknown,Login failed for user ''. The user
is not associated with a trusted SQL Server connection. [CLIENT:
192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 18452<c/Severity: 14<c/>
State: 1.
10/26/2007 16:35:54,Logon, Unknown,SSPI handshake failed with error
code 0x8009030c while establishing a connection with integrated
security; the connection has been closed. [CLIENT: 192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 17806<c/Severity: 20<c/>
State: 2.
I'm baffled by this, I've even tried connecting to the server using
oSQL, that was successful, but with vb.net from a web app, it fails.
There's a code snippet below

<code>
strSQL = "SELECT * FROM LOGINS WHERE Username='" & strUsername & "'
AND Password='" & strPassword & "'"

myconnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs("ConfigCon") ) 'get
from web.config
myCommand = New SqlCommand(strS QL, myconnection)

Try
If (myCommand.Conn ection.State <ConnectionStat e.Open)
Then 'check connection state
myCommand.Conne ction.Open() ' open connection if
needed
End If
</code>

Oct 26 '07 #2
if your local asp.net site is running under iis, then you need to set to
run under a domain account with access the sqlserver.

1) if you only hit the website locally just set impersonate=tru e in the
web config and require authenication to ntlm in iis

2) if your local box is vista or server2003 set the app pool for the
asp.net site to the desired domain account.

3) if none of above, in web.config set impersonate with a useName and
password.

-- bruce (sqlwork.com)

eruth wrote:
There are loads of post on this, but nothing that seems to cover my
exact problem ;)

I have an ASP.Net 1.1 web application running on my local machine. I
want to connect to an SQL 2005 server running on Windows 2003.

If I use SQL authentication, all is fine and dandy. If I want to use
windows authentication it gives the above error. My SQL server is set
to allow both methods (first thing I checked) and is part of the
domain (2nd thing checked).

If I create a UDL file on the local machine and connect to the SQL
server with that, it reports that the test connection is successful,
so I took the connection string from that and used it in my
web.config, but got the above error.

Here's my connection string using SQL Authentication

"Password=RagUs er;Persist Security Info=True;User ID=RagUser;Init ial
Catalog=KBDL_Co nfig;Data Source=UKBOLDEV 01"

and the connection string using windows authentication

"Integrated Security=SSPI;P ersist Security Info=False;Init ial
Catalog=KBDL_Co nfig;Data Source=ukboldev 01"

Even adding 'Trusted Connection=True ' to the windows authentication
doesn't help!

SQL 2005 has errors in it's log, it shows.

10/26/2007 16:35:54,Logon, Unknown,Login failed for user ''. The user
is not associated with a trusted SQL Server connection. [CLIENT:
192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 18452<c/Severity: 14<c/>
State: 1.
10/26/2007 16:35:54,Logon, Unknown,SSPI handshake failed with error
code 0x8009030c while establishing a connection with integrated
security; the connection has been closed. [CLIENT: 192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 17806<c/Severity: 20<c/>
State: 2.
I'm baffled by this, I've even tried connecting to the server using
oSQL, that was successful, but with vb.net from a web app, it fails.
There's a code snippet below

<code>
strSQL = "SELECT * FROM LOGINS WHERE Username='" & strUsername & "'
AND Password='" & strPassword & "'"

myconnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs("ConfigCon") ) 'get
from web.config
myCommand = New SqlCommand(strS QL, myconnection)

Try
If (myCommand.Conn ection.State <ConnectionStat e.Open)
Then 'check connection state
myCommand.Conne ction.Open() ' open connection if
needed
End If
</code>
Oct 26 '07 #3
Bruce,

To address your suggestions.

1) The problem with this solution is that once this site is deployed,
the webserver will be in the DMZ, and the SQL server on the inside of
the firewall.
2) May be possible when deployed as the live servers will both be
2003, however my development box (local pc) is XPsp2
3) I'll try this and let you know.
On 26 Oct, 17:29, bruce barker <nos...@nospam. comwrote:
if your local asp.net site is running under iis, then you need to set to
run under a domain account with access the sqlserver.

1) if you only hit the website locally just set impersonate=tru e in the
web config and require authenication to ntlm in iis

2) if your local box is vista or server2003 set the app pool for the
asp.net site to the desired domain account.

3) if none of above, in web.config set impersonate with a useName and
password.

-- bruce (sqlwork.com)

eruth wrote:
There are loads of post on this, but nothing that seems to cover my
exact problem ;)
I have an ASP.Net 1.1 web application running on my local machine. I
want to connect to an SQL 2005 server running on Windows 2003.
If I use SQL authentication, all is fine and dandy. If I want to use
windows authentication it gives the above error. My SQL server is set
to allow both methods (first thing I checked) and is part of the
domain (2nd thing checked).
If I create a UDL file on the local machine and connect to the SQL
server with that, it reports that the test connection is successful,
so I took the connection string from that and used it in my
web.config, but got the above error.
Here's my connection string using SQL Authentication
"Password=RagUs er;Persist Security Info=True;User ID=RagUser;Init ial
Catalog=KBDL_Co nfig;Data Source=UKBOLDEV 01"
and the connection string using windows authentication
"Integrated Security=SSPI;P ersist Security Info=False;Init ial
Catalog=KBDL_Co nfig;Data Source=ukboldev 01"
Even adding 'Trusted Connection=True ' to the windows authentication
doesn't help!
SQL 2005 has errors in it's log, it shows.
10/26/2007 16:35:54,Logon, Unknown,Login failed for user ''. The user
is not associated with a trusted SQL Server connection. [CLIENT:
192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 18452<c/Severity: 14<c/>
State: 1.
10/26/2007 16:35:54,Logon, Unknown,SSPI handshake failed with error
code 0x8009030c while establishing a connection with integrated
security; the connection has been closed. [CLIENT: 192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 17806<c/Severity: 20<c/>
State: 2.
I'm baffled by this, I've even tried connecting to the server using
oSQL, that was successful, but with vb.net from a web app, it fails.
There's a code snippet below
<code>
strSQL = "SELECT * FROM LOGINS WHERE Username='" & strUsername & "'
AND Password='" & strPassword & "'"
myconnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs("ConfigCon") ) 'get
from web.config
myCommand = New SqlCommand(strS QL, myconnection)
Try
If (myCommand.Conn ection.State <ConnectionStat e.Open)
Then 'check connection state
myCommand.Conne ction.Open() ' open connection if
needed
End If
</code>
Oct 29 '07 #4
One final note - yes suggestion 3 did work, but on talking to the nice
security people here, I was advised that using windows authentication
might not be a good idea. So I'm going to stick with the SQL
authentication and write a series of SQL jobs that will make sure the
right users with the right permissions exist at the right time for my
web pages to connect to the database.

On 29 Oct, 09:15, eruth <emma.pearl...@ gmail.comwrote:
Bruce,

To address your suggestions.

1) The problem with this solution is that once this site is deployed,
the webserver will be in the DMZ, and theSQLserveron the inside of
the firewall.
2) May be possible when deployed as the live servers will both be
2003, however my development box (local pc) is XPsp2
3) I'll try this and let you know.

On 26 Oct, 17:29, bruce barker <nos...@nospam. comwrote:
if your local asp.net site is running under iis, then you need to set to
run under a domain account with access the sqlserver.
1) if you only hit the website locally just set impersonate=tru e in the
web config and require authenication to ntlm in iis
2) if your local box is vista or server2003 set the app pool for the
asp.net site to the desired domain account.
3) if none of above, in web.config set impersonate with a useName and
password.
-- bruce (sqlwork.com)
eruth wrote:
There are loads of post on this, but nothing that seems to cover my
exact problem ;)
I have an ASP.Net 1.1 web application running on my local machine. I
want to connect to anSQL2005server running on Windows 2003.
If I useSQLauthentic ation, all is fine and dandy. If I want to use
windows authentication it gives the above error. MySQLserveris set
to allow both methods (first thing I checked) and is part of the
domain (2nd thing checked).
If I create a UDL file on the local machine and connect to theSQL
>serverwith that, it reports that the testconnectioni s successful,
so I took theconnectionst ring from that and used it in my
web.config, but got the above error.
Here's myconnectionstr ing usingSQLAuthent ication
"Password=RagUs er;Persist Security Info=True;UserI D=RagUser;Initi al
Catalog=KBDL_Co nfig;Data Source=UKBOLDEV 01"
and theconnectionst ring using windows authentication
"Integrated Security=SSPI;P ersist Security Info=False;Init ial
Catalog=KBDL_Co nfig;Data Source=ukboldev 01"
Even adding 'TrustedConnect ion=True' to the windows authentication
doesn't help!
>SQL2005 has errors in it's log, it shows.
10/26/2007 16:35:54,Logon, Unknown,Loginfa iledforuser''. Theuser
isnotassociated with atrustedSQLServ erconnection. [CLIENT:
192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 18452<c/Severity: 14<c/>
State: 1.
10/26/2007 16:35:54,Logon, Unknown,SSPI handshakefailed with error
code 0x8009030c while establishing aconnectionwith integrated
security; theconnectionha s been closed. [CLIENT: 192.168.41.75]
10/26/2007 16:35:54,Logon, Unknown,Error: 17806<c/Severity: 20<c/>
State: 2.
I'm baffled by this, I've even tried connecting to theserverusing
oSQL, that was successful, but with vb.net from a web app, it fails.
There's a code snippet below
<code>
strSQL = "SELECT * FROM LOGINS WHERE Username='" & strUsername & "'
AND Password='" & strPassword & "'"
myconnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs("ConfigCon") ) 'get
from web.config
myCommand = New SqlCommand(strS QL, myconnection)
Try
If (myCommand.Conn ection.State <ConnectionStat e.Open)
Then 'checkconnectio nstate
myCommand.Conne ction.Open() ' openconnectioni f
needed
End If
</code>

Oct 30 '07 #5

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

Similar topics

2
14641
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 authentication to establish the odbc connection however it gives the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." I am guessing that the odbc connection is trying to pass the credentials of job\john...
1
2725
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 mode="Windows" /> <identity impersonate="true"/> to our web.config file. In IIS, annonymous access is unchecked, digest authentication is unchecked, basic authentication is unchecked, and Integrated Windows Authentication is checked.
2
2264
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 other web server (IIS5.0) win2000. Actualy, I only have problem to connect with the Database that she still hosted on the the XPDEVSERVER mahcine . I get this error msg when I ask a aspx page that is connected to the database: Login failed for user...
4
7227
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 user account (with same password as aspnet user on IIS (Devweb01)) 2) edited local machine.config file <ProcessModel> Password attribute to same password (both on IIS and SQL Machine) 3) SQL Server security is Sql Server and Windows
3
1995
by: Nicola Marchiori | last post by:
Hi I need some help. I am developing a Web App in one PC running IIS. I am trying to connect to to MSDE on another PC, but it's not working. This is the message i got Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
1
2050
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 itself sits on an IIS6.0 server. And the database is on an SQL2000 server with SP 3a. On Tuesday we started getting an error when we tried to call up the application. It said: Login failed for user '(null)'. Reason: Not associated with a trusted...
0
1043
by: Dennis | last post by:
I am working on an ASP.NET 2.0 site. It runs fine on my local PC. When I deploy it to the server I get this error: Login failed for user ''. The user is not associated with a trusted SQL Server connection. SqlException (0x80131904): Login failed for user ''. The user is not associated with a trusted SQL Server connection.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734867
8
4702
by: =?Utf-8?B?U2hlcndvb2Q=?= | last post by:
Greetings, I am attempting to use the following code to establish a connection to a SQL Server database. However, when I execute the code, I receive the following error: "Login failed for user 'guest'. The user is not associated with a trusted SQL Server connection." SqlConnection conn = new SqlConnection("Data
0
10916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10598
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10657
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7836
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4071
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.