Solved

Login failed for user 'SKYNET\IUSR_SKYNET'.

Posted on 2006-11-17
10
202 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

15 Experts available now in Live!

Get 1:1 Help Now