|
-
Sep 5th, 2009, 01:03 PM
#1
Thread Starter
New Member
problem in login form
HI I am using below mentioned code for a login form. I want to create a login form in which user would pass the uid and pw and if both values matches with the table then it should open frmmenu.vb pls help
Try
cn = New OleDb.OleDbConnection("provider=SQLOLEDB; Data Source=USER\SQLEXPRESS;Initial Catalog=IMS;User ID=test; password=test")
cn.Open()
cmd.Connection = cn
tlogin_id = UsernameTextBox.Text
tpswd = PasswordTextBox.Text
cmd.CommandText = "select * from login where login_name='" & tlogin_id & "' and pwd='" & tpswd & "'"
MsgBox(cmd.CommandText)
dr = cmd.ExecuteReader()
If tlogin_id = UsernameTextBox.Text Then
If tpswd = PasswordTextBox.Text Then
frmMenu.ShowDialog()
Else
MessageBox.Show(" Password is incorrect")
End If
Else
MessageBox.Show(" Uid is incorrect")
End If
cn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
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
|