Deleteing rows in a datatable

  • Thread starter Thread starter Anita C
  • Start date Start date
A

Anita C

Hi,
I have a datable. I need to delete some rows of the datatable. The rows to
be deleted are those which have the same value in the 'FolderName' column as
that in another row of the datatable, so that no duplicates on the basis of
the 'FolderName' column exist.
Can someone please share code of how to achieve the above in c#?
Thanks in advance
 
Hi,

The easiest way is to use a sql command such as:
DELETE FROM Table WHERE FolderName=AnotherColumn

Create a command instance with the sql statament above and fire
ExecuteNonQuery().
 
Back
Top