Solved

Login failed for user 'SKYNET\IUSR_SKYNET'.

Posted on 2006-11-17
10
205 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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