title: Table doesn't have a primary key
body: <p>i get the following exception  (missing primary key) in the line of using Find() method</p>
  
  <blockquote>
    <p>"Table doesn't have a primary key."</p>
  </blockquote>
  
  <p>I've rechecked the Database and all Primary Key columns are set correctly. </p>
  
  <p>my code:</p>
  
  <pre><code>DataTable dt = p.GetAllPhotos(int.Parse(Id));
  DataTable temp = new DataTable();
  temp = dt.Clone();
  temp = (DataTable)(Session["currentImage"]);
  DataTable dtvalid = new DataTable();
  dtvalid = dt.Clone();
  DataRow[] drr = new DataRow[1];
  drr[0] = dt.Rows.Find((int.Parse(temp.Rows[0]["photoId"].ToString()))+1);
  foreach (DataRow dr in drr)
  {
      dtvalid.ImportRow(dr);
  }
  dtvalid.AcceptChanges();'
  </code></pre>