Checking Value against database

dan463va

Member
Joined
Sep 25, 2006
Messages
7
Programming Experience
Beginner
I have a program that uses a database to display information. The user is allowed to enter in information and save it to the database. How can I code something that will check what a user enters in a textbox with a value already in the database. If it is not in the database I will display a messagebox error. I've tried things like,

VB.NET:
If txtTextbox.text <> objReader("SerialNumber") Then
 
MessageBox.Show
 
Return
 
End If
When the program runs it will crash out and not work properly.
 
Last edited by a moderator:
Back
Top