title: Datatable/Datarow If Exists Update Else Insert
body: <p>Trying to find an answer to this has proven difficult, since all the answers deal with SQL!</p>
  
  <p>I have a Datatable <code>TestTable</code>. In this DataTable I have three columns, <code>ID</code>, <code>ValueX</code>, and <code>ValueY</code>. As I add new records to this datatable, I am trying to make an insert method that looks to see if the record exists, but cannot get a Select statement to use multiple fields. In my situation, I need to see if the Datatable contains a record that equals ID and ValueX, if it does, update. Otherwise, add the new record to the datatable. </p>
  
  <pre><code>public void Insert(string ID, string ValueX, string ValueY)
  {
  DataRow dr = TestTable.NewRow();
  dr["ID"] = ID;
  dr["ValueX"] = ValueX
  dr["ValueY"] = ValueY;
  TestTable.Rows.Add(dr);
  }
  </code></pre>