Good Day I want to create a security log in that start up when the computer is turn on.
Im having problem on multi user once the user ID is logged in it also logged in in another computer, i dont know how to add this codes can some one help me this is my code in my log in form. im using vb.net 2005 and back end is MySQL. Thank You so much.

Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
Dim myCommand As New MySqlCommand
Dim myAdapter As New MySqlDataAdapter
Dim myData As MySqlDataReader

Dim SQL As String
'Our MySQL Query
Dim IDstudent As String = mtxtID.Text.Replace("'", "\'")
Dim Password As String = txtPassword.Text.Replace("'", "\'")
SQL = "SELECT * FROM `student` WHERE `idstudent` = '" + IDstudent + "' AND `password` = '" + Password + "'"

myCommand.Connection = conn
myCommand.CommandText = SQL
myAdapter.SelectCommand = myCommand
Try
'Try to execute the query
myData = myCommand.ExecuteReader()
myData.Read()
If myData.HasRows = 0 Then 'Checkes if a row with the user and password exist.
'If no outputs this:
MsgBox("StudentID and Password dont match!.")
myData.Close()
Else
'if yes outputs this:
MsgBox("Welcome " + myData.GetString("name") + "!.")
myData.Close()
mtxtID.Clear()
txtPassword.Clear()


Dim F2 As New LogIn(Me)
F2.Show()
Me.Hide()

End If
Catch ex As MySqlException
'If fail outputs MySQL Error
MsgBox(ex.Message)
Finally

End Try
RestartExplorer()
End Sub

Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
Dim myCommand As New MySqlCommand
Dim myAdapter As New MySqlDataAdapter
Dim myData As MySqlDataReader

Dim SQL As String
'Our MySQL Query
Dim IDstudent As String = mtxtID.Text.Replace("'", "\'")
Dim Password As String = txtPassword.Text.Replace("'", "\'")
SQL = "SELECT * FROM `student` WHERE `idstudent` = '" + IDstudent + "' AND `password` = '" + Password + "'"

myCommand.Connection = conn
myCommand.CommandText = SQL
myAdapter.SelectCommand = myCommand
Try
'Try to execute the query
myData = myCommand.ExecuteReader()
myData.Read()
If myData.HasRows = 0 Then 'Checkes if a row with the user and password exist.
'If no outputs this:
MsgBox("StudentID and Password dont match!.")
myData.Close()
Else
'if yes outputs this:
MsgBox("Welcome " + myData.GetString("name") + "!.")
myData.Close()
mtxtID.Clear()
txtPassword.Clear()


Dim F2 As New LogIn(Me)
F2.Show()
Me.Hide()

End If
Catch ex As MySqlException
'If fail outputs MySQL Error
MsgBox(ex.Message)
Finally

End Try
RestartExplorer()
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.