Solved

Login failed for user 'SKYNET\IUSR_SKYNET'.

Posted on 2006-11-17
10
203 Views
Last Modified: 2010-04-23
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.ConnectionString = 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
0
Comment
Question by:SirReadAlot
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17967635
Try :


    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.ConnectionString = sConnectionString
        Return conHalloween
    End Function
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17967645
is that your problem ???
your question seems to be different yet the code won't work anyway ..
0
 

Author Comment

by:SirReadAlot
ID: 17967692
i will try it
0
 
LVL 29

Expert Comment

by:Nightman
ID: 17967699
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.
0
 

Author Comment

by:SirReadAlot
ID: 17967705
conHalloween.ConnectionString = sConnectionString

saying sConnectionString is not declared
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 35

Expert Comment

by:YZlat
ID: 17967711
0
 

Author Comment

by:SirReadAlot
ID: 17967734
how do i grant the access
0
 

Author Comment

by:SirReadAlot
ID: 17967752
okay, it works i granted the user


thanks
0
 
LVL 29

Accepted Solution

by:
Nightman earned 500 total points
ID: 17967755
Open Enterprise Manager on the SQL Server, go to security-->logins right click - new login.
Type in the name SKYNET\IUSR_SKYNET, select Windows Authentication and select the server name from the domain dropdown list. Under the database access tab, select the database to which this user has access.
0
 
LVL 29

Expert Comment

by:Nightman
ID: 17967773
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SLMGR Switches Are Not Working On KMS Host 3 69
Setting runtime form location 4 31
vb.net - How to check if current user is an administrator? 6 34
Variable Event ? 3 23
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now