I want to filter the users input if it is already in the users database
here's my code: Problem is only one users has been detected. : I do not know how to get users database into one variable..
Me.user = txtbox.text
Try
cnn.Open()
Dim stm As String = "Select mgt_user from tbl_management"
Dim cmd As MySqlClient.MySqlCommand = New MySqlClient.MySqlCommand(stm, cnn)
Dim reader As MySqlClient.MySqlDataReader = cmd.ExecuteReader()
reader.Read()
Mgtuser = reader.GetString("mgt_user")
reader.Close()
If Me.user = Mgtuser Then
MsgBox("the name is already exists")
End If
If Me.user <> Mgtuser Then
MsgBox("ndi xa equal")
End If
Catch ex As MySqlClient.MySqlException
MsgBox("INVALID ACCOUNT", MessageBoxIcon.Error, "CSM")
Finally
cnn.Close()
End Try
THANKS IN ADVANCE
here's my code: Problem is only one users has been detected. : I do not know how to get users database into one variable..
Me.user = txtbox.text
Try
cnn.Open()
Dim stm As String = "Select mgt_user from tbl_management"
Dim cmd As MySqlClient.MySqlCommand = New MySqlClient.MySqlCommand(stm, cnn)
Dim reader As MySqlClient.MySqlDataReader = cmd.ExecuteReader()
reader.Read()
Mgtuser = reader.GetString("mgt_user")
reader.Close()
If Me.user = Mgtuser Then
MsgBox("the name is already exists")
End If
If Me.user <> Mgtuser Then
MsgBox("ndi xa equal")
End If
Catch ex As MySqlClient.MySqlException
MsgBox("INVALID ACCOUNT", MessageBoxIcon.Error, "CSM")
Finally
cnn.Close()
End Try
THANKS IN ADVANCE