title: Compare two datarows
body: <p>I have a datatable with multiple rows inside it. I have got 1 more row and I want to check if this row is a duplicate of the existing rows in the datatable. So I tried like:</p>
  
  <pre><code>DataTable dataTable = GetTable();
  if (dataTable.Rows.Count &gt; 1)
  {
      for (int i = 0; i &lt; dataTable.Rows.Count; i++)
      {
          var dataRow = dataTable.Rows[i];
  
          if (dt.Rows.Contains(dataRow) &amp;&amp; dt.Rows.Count != 0)  // Giving error
              continue;
          dt.ImportRow(dataRow);
          return dataRow;
      }
  }
  </code></pre>
  
  <p>Here, my <code>dataTable</code> can also be null/empty for the first time.</p>
  
  <p>But its giving error as:</p>
  
  <blockquote>
    <p>Table doesn't have a primary key.</p>
  </blockquote>
  
  <p>Can anyone help me please. If additional code is required, just comment. </p>