Question : .DefaultView.RowFilter to check duplicate in datatable is terribly slow

Hi,
I have used  .DefaultView.RowFilter to check duplicate in datatable.This is fine if the table has few rows but or 1000 rows it is terrible slow.
What i am doing here is adding  rows from one datatable to another for which i  do not want to add duplicates.
Any suggestions ?

Cheers

Answer : .DefaultView.RowFilter to check duplicate in datatable is terribly slow

One way as I see is:
Copy all data of table2 in table1.

then select unique values from table1 and truncate table 2 and copy unique data into table2.

like:

SELECT DISTINCT [ID]
     ,[Name]
     ,[ColDate]
 FROM [Table1]


now table2 has just unique values.

Does it make sense ??
Random Solutions  
 
programming4us programming4us