Thanks everyone for your contributions on this simple issue.
Thanks too that I've learnt about Alt key.
I got the solution of this question anyway, I think I was't thinking when I asked in the first place. Thanks anyway.
Code:'Check if there is duplicate UserName in the Database MyQry = "SELECT * FROM UsersTable WHERE UserName = '" & TxtUserName.Text & "'" MyCmd = New OleDbCommand(MyQry, Conn) MyCmd.ExecuteNonQuery() DTR = MyCmd.ExecuteReader Select Case DTR.Read Case True MsgBox(Prompt:="The provided UserName is not availble. Plese choose another one.", Buttons:=MsgBoxStyle.Exclamation, Title:="UserNameError") Case Else 'If Username is available, save the information to the database Dim DBUserName As String = DTR("UserName") Dim _UserName As String = TxtUserName.Text MyQry = "INSERT INTO UsersTable(UserName,FullName,UserPassword) VALUES('" & TxtUserName.Text & "','" & TxtFullName.Text & "','" & TxtConfirmPassword.Text & "')" MyCmd = New OleDbCommand(MyQry, Conn) With MyCmd .ExecuteNonQuery() End With Close() End Select




Reply With Quote
