R
Rohan Danushka
Guest
Hello,
I'm Creating User Login Form.Please I need your help for fulfill my requirement.
1) With this Code I can Login. But how can I login as multi User (SA,Admin,User)?
Public SQL As String
Public CMD As New SqlCommand
Public DS As New DataSet()
Public DR As SqlDataReader
Public DA As New SqlDataAdapter
Public TAB As New DataTable
Public K9DataConn As New SqlConnection("Data Source=-----------------")
K9DataConn.Close()
Try
SQL = "select * from K9User where UName = @UserName and UPassword = @password"
K9DataConn.Open()
CMD = New SqlCommand(SQL, K9DataConn)
CMD.Parameters.Add("@UserName", SqlDbType.VarChar).Value = FrmLogin.TxtUser.Text
CMD.Parameters.Add("@password", SqlDbType.VarChar).Value = FrmLogin.TxtPW.Text
Dim ADAP As New SqlDataAdapter(CMD)
Dim TAB As New DataTable()
ADAP.Fill(TAB)
If TAB.Rows.Count <= 0 Then
MessageBox.Show("Username Or Password Are Invalid")
Else
MessageBox.Show("Login Successfully")
FrmLogin.Hide()
FrmMain.Show()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
2) How to Use SASH Password for login with this
RohanD
Continue reading...
I'm Creating User Login Form.Please I need your help for fulfill my requirement.
1) With this Code I can Login. But how can I login as multi User (SA,Admin,User)?
Public SQL As String
Public CMD As New SqlCommand
Public DS As New DataSet()
Public DR As SqlDataReader
Public DA As New SqlDataAdapter
Public TAB As New DataTable
Public K9DataConn As New SqlConnection("Data Source=-----------------")
K9DataConn.Close()
Try
SQL = "select * from K9User where UName = @UserName and UPassword = @password"
K9DataConn.Open()
CMD = New SqlCommand(SQL, K9DataConn)
CMD.Parameters.Add("@UserName", SqlDbType.VarChar).Value = FrmLogin.TxtUser.Text
CMD.Parameters.Add("@password", SqlDbType.VarChar).Value = FrmLogin.TxtPW.Text
Dim ADAP As New SqlDataAdapter(CMD)
Dim TAB As New DataTable()
ADAP.Fill(TAB)
If TAB.Rows.Count <= 0 Then
MessageBox.Show("Username Or Password Are Invalid")
Else
MessageBox.Show("Login Successfully")
FrmLogin.Hide()
FrmMain.Show()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
2) How to Use SASH Password for login with this
RohanD
Continue reading...