How to check if the value is already there before inserting into SQL Server using asp.net?
Here is the current code :
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into customers_testing (cust_id,cust_name,cust_group,acc_mgr2,acc_mgr) values('" + textCustID.Text + "','" + textCustName.Text + "','" + textCustSector.Text + "','" + dropdAccAdmin.Text + "','" + dropdAccManager.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
Label1.Visible = true;
Label1.Text = "New Customer Added Successfully";
textCustID.Text = "";
}