473,237 Members | 1,116 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,237 software developers and data experts.

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=RagUser;Persist Security Info=True;User ID=RagUser;Initial
Catalog=KBDL_Config;Data Source=UKBOLDEV01"

and the connection string using windows authentication

"Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=KBDL_Config;Data Source=ukboldev01"

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(ConfigurationSettings.AppSettings("C onfigCon")) 'get
from web.config
myCommand = New SqlCommand(strSQL, myconnection)

Try
If (myCommand.Connection.State <ConnectionState.Open)
Then 'check connection state
myCommand.Connection.Open() ' open connection if
needed
End If
</code>

Oct 26 '07 #1
4 12018
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********************@k79g2000hse.googlegroups.co m...
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=RagUser;Persist Security Info=True;User ID=RagUser;Initial
Catalog=KBDL_Config;Data Source=UKBOLDEV01"

and the connection string using windows authentication

"Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=KBDL_Config;Data Source=ukboldev01"

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(ConfigurationSettings.AppSettings("C onfigCon")) 'get
from web.config
myCommand = New SqlCommand(strSQL, myconnection)

Try
If (myCommand.Connection.State <ConnectionState.Open)
Then 'check connection state
myCommand.Connection.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=true 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=RagUser;Persist Security Info=True;User ID=RagUser;Initial
Catalog=KBDL_Config;Data Source=UKBOLDEV01"

and the connection string using windows authentication

"Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=KBDL_Config;Data Source=ukboldev01"

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(ConfigurationSettings.AppSettings("C onfigCon")) 'get
from web.config
myCommand = New SqlCommand(strSQL, myconnection)

Try
If (myCommand.Connection.State <ConnectionState.Open)
Then 'check connection state
myCommand.Connection.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=true 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=RagUser;Persist Security Info=True;User ID=RagUser;Initial
Catalog=KBDL_Config;Data Source=UKBOLDEV01"
and the connection string using windows authentication
"Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=KBDL_Config;Data Source=ukboldev01"
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(ConfigurationSettings.AppSettings("C onfigCon")) 'get
from web.config
myCommand = New SqlCommand(strSQL, myconnection)
Try
If (myCommand.Connection.State <ConnectionState.Open)
Then 'check connection state
myCommand.Connection.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=true 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 anSQL2005serverrunning on Windows 2003.
If I useSQLauthentication, 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 testconnectionis successful,
so I took theconnectionstring from that and used it in my
web.config, but got the above error.
Here's myconnectionstring usingSQLAuthentication
"Password=RagUser;Persist Security Info=True;UserID=RagUser;Initial
Catalog=KBDL_Config;Data Source=UKBOLDEV01"
and theconnectionstring using windows authentication
"Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=KBDL_Config;Data Source=ukboldev01"
Even adding 'TrustedConnection=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,Loginfailedforuser''. Theuser
isnotassociatedwith atrustedSQLServerconnection. [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 handshakefailedwith error
code 0x8009030c while establishing aconnectionwith integrated
security; theconnectionhas 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(ConfigurationSettings.AppSettings("C onfigCon")) 'get
from web.config
myCommand = New SqlCommand(strSQL, myconnection)
Try
If (myCommand.Connection.State <ConnectionState.Open)
Then 'checkconnectionstate
myCommand.Connection.Open() ' openconnectionif
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
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...
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...
3
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...
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...
0
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...
8
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.