SirReadAlot
asked on
Login failed for user 'SKYNET\IUSR_SKYNET'.
Hi experts,
I got the above error while running this code--
Private Shared Function Connection() As SqlConnection
Dim conHalloween As New SqlConnection
Dim sConnectionString As String _
= "Data Source= SKYNET;" _
& "Initial Catalog=Halloween;" _
& "Integrated Security=SSPI"
conHalloween.ConnectionStr ing = sConnectionString
Return conHalloween
End Function
I have changed the security setting in my sql server to read both windows and sql authentications
how do i solve the above error pls.
thanks guys
I got the above error while running this code--
Private Shared Function Connection() As SqlConnection
Dim conHalloween As New SqlConnection
Dim sConnectionString As String _
= "Data Source= SKYNET;" _
& "Initial Catalog=Halloween;" _
& "Integrated Security=SSPI"
conHalloween.ConnectionStr
Return conHalloween
End Function
I have changed the security setting in my sql server to read both windows and sql authentications
how do i solve the above error pls.
thanks guys
is that your problem ???
your question seems to be different yet the code won't work anyway ..
your question seems to be different yet the code won't work anyway ..
ASKER
i will try it
Have you granted the IUSR_SKYNET local user access to the database? You are using integrated security, so it will connect in the context of the user. Either grant access to the local user account, connect with a SQL login account or use windows authentication and impersonation to connect to the SQL Server.
ASKER
conHalloween.ConnectionStr ing = sConnectionString
saying sConnectionString is not declared
saying sConnectionString is not declared
ASKER
how do i grant the access
ASKER
okay, it works i granted the user
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK, you're ahead of me ;)
Note that best practice for security is to use windows authentication with impersonation, either connecting as the user that is connecting to the site or impersonating a specific domain account (you would set this up in the web.config) .
Next best would be to use a specific SQL login and use that in your connection string.
Note that best practice for security is to use windows authentication with impersonation, either connecting as the user that is connecting to the site or impersonating a specific domain account (you would set this up in the web.config) .
Next best would be to use a specific SQL login and use that in your connection string.
Private Shared Function Connection() As SqlConnection
Dim conHalloween As New SqlConnection
Dim sConnectionString As String = & _
"Data Source= SKYNET;" & _
"Initial Catalog=Halloween;" & _
"Integrated Security=SSPI"
conHalloween.ConnectionStr
Return conHalloween
End Function