title: An equivalent to If contains using SQL?
body: <p>I am creating a program that needs to check if a value exists in column 1 of my database, if not then add it or if it does then add 1 to the value in column 2.</p>
  
  <p>Currently the program only adds each value to the database and I don't know how to do the next part, it should do something like:</p>
  
  <pre><code>if column 1 contains (textbox)
  column 2 = column 2 + 1
  
  else column 1 doesnt contain (textbox)
  add to column 1
  </code></pre>
  
  <p>I'm only just learning C# and this is pretty much the first SQL i've had to do, so please keep any answers simple.</p>
  
  <p>This is part of the code that currently works.</p>
  
  <pre><code>System.Data.SqlClient.SqlCommandBuilder cb;
  cb = new System.Data.SqlClient.SqlCommandBuilder(da);
  DataRow dRow = ds1.Tables["Tags"].NewRow();
  dRow[0] = txtSplittext.Text;
  dRow[1] = 1;
  ds1.Tables["Tags"].Rows.Add(dRow);
  MaxRows = MaxRows + 1;
  inc = MaxRows - 1;
  da.Update(ds1, "Tags");
  </code></pre>
  
  <p>Thanks for any help you can give me.</p>