Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
| Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 23rd, 2004, 01:08 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error: Login failed for user sa -urgent

when i run my .NET web application i'm getting this error ::
"Login failed for user sa"
can anyone help me

  #2 (permalink)  
Old September 23rd, 2004, 01:48 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

can you provide more details...are you using any database??

  #3 (permalink)  
Old September 23rd, 2004, 10:24 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Do not use the SA account - This is a very bad idea.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
  #4 (permalink)  
Old September 28th, 2004, 03:29 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

my code is as follows ::

Public Function exists(ByVal username As String, ByVal pwd As String)


        Dim con1 As New SqlConnection(" server=(local);uid=sa;pwd=;database=usersdb;")
        Dim myreader1 As SqlDataReader
        Dim eid
        Dim cnt, count As Integer
        Dim ex As Boolean
    

        Try
        con1.Open()
        Dim sqlcommand1 As SqlCommand
        sqlcommand1 = New SqlCommand("select eid,cnt as count(*) from userdetails where usrname = '" & username & "' and pwd=' " & pwd & "' ", con1)
        myreader1 = sqlcommand1.ExecuteReader()
        Do While (myreader1.Read())
            eid = myreader1("eid").ToString()
            ex = True
        Loop

        Finally

        If Not (myreader1 Is Nothing) Then
            ex = False
            myreader1.Close()
            con1.Close()
        End If

        End Try

             If ex Then
            Label2.Text = "user Exists"
        Else
            Label2.Text = "User does not exists"

        End If
    End Function
  #5 (permalink)  
Old September 28th, 2004, 03:44 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

can u try giving ur sql servername insetd of (local).

again as Hal said, it is a very bad idea to use sa account ant that too without a password.

Your query also seems to be incorrect, You have a summary field and another field, but the sql statement does not contain a group by clause.

"cnt as count(*) " this doesnt make sence either

Regards
Ganesh
  #6 (permalink)  
Old September 28th, 2004, 05:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

cross-post, see http://p2p.wrox.com/topic.asp?TOPIC_ID=19892


Similar Threads
Thread Thread Starter Forum Replies Last Post
Login failed for user 'sa' scarlisle BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 29th, 2009 09:51 AM
Login Failed for User sa r_taduri Crystal Reports 1 November 29th, 2009 09:50 AM
Login failed for user 'sa'. ernestlambert BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 7th, 2005 12:26 PM
Urgent : Getting Error :Login failed for user sa hums SQL Server ASP 1 September 28th, 2004 05:51 AM
Login failed for user 'sa' ameg BOOK: Beginning ASP 3.0 5 April 6th, 2004 01:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.