if you want to check whether the product exists or not before you update it then you can use sqlDataAdapter.
DataTable dt = new DataTable();
string check = "SELECT * FROM TABLENAME WHERE product = '"+textBox1.Text+"';
sqlcommand cmd = new sqlcommand("check");
sqlDataAdapter adap = new sqlDataAdapter("cmd", yourdatabaseconnection);
try
{
adap.Fill(dt)
}
catch(exception ex)
{
throw ex;
}
if(dt.Rows.Count>0)
{
//here goes your code for update
}
else
{
// here goes code for new insertion
}
I have demonstrated using concat. Its best idea to use Stored Procedure. Plz use stored procedure while implementing..
Hope i met ur requirement!