|
-
Aug 6th, 2004, 11:37 AM
#1
Thread Starter
Junior Member
Help
What is wrong with this code i get a error everytime
rivate Sub log_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles log.Click
Dim strCommandText As String = "SELECT COUNT(*) as USRMATCH FROM USER WHERE " & _
"USERNAME = '" & Me.user.Text & "' AND PASSWORD = '" & Me.pass.Text & "'"
Dim sqlconn As New SqlConnection _
("data source = localhost; initial catalog=ICS; user ID=sa;password=xxx")
sqlconn.Open()
Dim iResult As Integer
' iResult = Convert.ToInt32(SqlConn)
If iResult <> 0 Then
SqlConn.Close()
Else
MsgBox("Invalid UserID or Password Please enter your UserName and Password")
End If
-
Aug 6th, 2004, 12:19 PM
#2
Lively Member
Can you post more information about the exception please?
Do you think my life is easy?
Do you think it's good to win?
do you think it's nice to kill?
Do you think learning is a must?
Do you think computers are nothing?
Do you think this post is stupid?
Do ypu think we're really humen?
DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !
-
Aug 6th, 2004, 12:50 PM
#3
Thread Starter
Junior Member
this is the error i get
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
the code is
Private Sub log_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles log.Click
Dim strCommandText As String = "SELECT COUNT(*) as USRMATCH FROM USER WHERE " & _
"USERNAME = '" & Me.user.Text & "' AND PASSWORD = '" & Me.pass.Text & "'"
Dim sqlconn As New SqlConnection _
("data source = localhost; initial catalog=ICS; user ID=sa;password=xxx")
sqlconn.Open()
Dim iResult As Integer
' iResult = Convert.ToInt32(SqlConn)
If iResult <> 0 Then
SqlConn.Close()
Else
MsgBox("Invalid UserID or Password Please enter your UserName and Password")
End If
-
Aug 9th, 2004, 12:58 AM
#4
Originally posted by cisco
data source = localhost;
Localhost? I doubt if that is correct. Has this worked in the past? Are you sure it's not (local) ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|