So, I need these codes to prevent duplicate Records when i'm inserting a new record. Basically when i'm trying to insert a new label, first of all it should check either this record already exist in the database or not.
This is the Button Code:
private void newBtn_Click_1(object sender, EventArgs e) {
Check_Item();
con = new SqlConnection(cs);
con.Open();
adapt = new SqlDataAdapter("INSERT INTO tbl_list (Label) VALUES ('" + lblBox.Text + "')",
con);
adapt.SelectCommand.ExecuteNonQuery();
con.Close();
MessageBox.Show("New Data Added Successfully",
"Notice",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
clearEditTab();
}
and i don't know what to write in the Check_Item