I would like to check if a user exists in the database. If the user does exists I would like to display an error mesage saying "User does exists"
How to check in my front end if those details exists and if they do display error message.
Below is my SQL:
Public Function CheckIfEmployeeExists(ClockNumber As String, ID As String) As DataTable
Dim sSQL As New System.Text.StringBuilder
Try
sSQL.Append(vbCrLf & " SELECT ClockNumber, ")
sSQL.Append(vbCrLf & " ID ")
sSQL.Append(vbCrLf & " FROM Emp")
sSQL.Append(vbCrLf & " WHERE ClockNumber= @ClockNumber AND ID= @ID ")
Dim sqlParameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)
sqlParameters.Add("ClockNumber", ClockNumber)
sqlParameters.Add("ID", ID)
Return Me.sqlExecutor(sSQL.ToString, sqlParameters, SQLCommunication.returnType.datatable)
Catch ex As Exception
Throw ex
End Try
End Function