User-646447061 posted
string stra = "IF NOT EXISTS (SELECT * FROM inventory) insert into inventory (barcode,item,jumlah) values ('" + item.SelectedValue + "','" + item.SelectedItem + "','" + jumlah.Text + "') else update inventory set
jumlah=jumlah + '" + jumlah.Text + "' where barcode='" + item.SelectedValue + "' and item ='" + item.SelectedItem + "'";
SqlCommand cmda = new SqlCommand(stra, con);
cmda.ExecuteNonQuery();