title: how to delete duplicate rows from ms access database (C#)
body: <p>I have been going through various sites and codes, but nothing seems to end my misery. Either they help to find and remove duplicates for a specific column or they remove only from the datatable, not the underlying database itself. I want to delete duplicate rows from table "table1" of my mdb file. </p>
  
  <p>To make my requirements clearer:</p>
  
  <ol>
  <li>there's no primary key set for any column in the table (and I cant afford to)</li>
  <li>I want to delete all duplicate rows but one! (order has no significance)</li>
  <li>I prefer deleting the duplicates from database more than first checking if such a row exist or not before updating database itself (if that's the last resort, which cant be, then that's  welcome)</li>
  <li><p>by duplicate rows I mean rows that are not distinct. for eg, in the following example,only 3rd and 5th row are duplicates. And I want to delete any of them.</p>
  
  <pre><code>      Name1  Name2    Name3
        tom    dick   harry
        tom    dick   mike
        ann    sara   mike
        sara   ann    mike
        ann    sara   mike
  </code></pre></li>
  </ol>
  
  <p>The duplicate rows should be deleted from database with a button click as follows</p>
  
  <pre><code>     private void button1_Click(object sender, EventArgs e)
       {
           deletedupes();
       }
  
      private void deletedupes()
      {
          OleDbConnection con = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\hi.mdb");
  
          DataSet ds = new DataSet();
          OleDbDataAdapter da = new OleDbDataAdapter("select * from table1", con);
          con.Open();
          da.Fill(ds, "table1");
  
          // what could be rest of the code??
      }
  </code></pre>
  
  <p>Thanks in advance. Yes I'm a novice..</p>