title: Insert/Update whole DataTable into database table C#
body: <p>I am facing an issue I hope to get it solved by here. I have 3 different tables in a <code>DataSet</code> and I want to insert it in the database table. </p>
  
  <p>I know I can do this using <code>SqlBulkCopy</code> but there is a catch and that is I want to check if the data already exists in the database then I want it to get updated instead of insert. </p>
  
  <p>And if the data doesn't exist in the database table, I want to insert it then. Any help on this would be appreciated. </p>
  
  <p>I know I can iterate it through each record and then fire a procedure which will check for its existence if it exists den update or else insert. But the data size is huge and iterating through each record would be a time taking process, I don't want to use this approach.</p>
  
  <p>Regards</p>