SELECT * FROM TABLENAME WHERE FIELDNAME = '" + YOURSEARCHSTRING + "';
if(MYDATATABLE.Rows.Count > 0) { Messagebox.Show("Record Already Exists"); }else { //Fire your insert query }
IF EXISTS(SELECT * FROM tablename WHERE condition ) BEGIN RAISERROR ('already entered',11,1) END ELSE BEGIN -- Insert query END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)