E
eruth
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("ConfigCon")) '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>
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("ConfigCon")) '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>