I have a populated DataTable in my code:
I am using SQL Server CE 4.0 and to solve performance problems, I am using SqlCeBulkCopy :
SqlCeBulkCopyOptions options = new SqlCeBulkCopyOptions(); options = options |= SqlCeBulkCopyOptions.KeepNulls; // Check for DB duplicates using (SqlCeBulkCopy bc = new SqlCeBulkCopy(strConn, options)) { dt = RemoveDuplicateRows(dt, "Email"); bc.DestinationTableName = "Recipients"; bc.WriteToServer(dt); }
RemoveDuplicateRows will remove duplicates from the DataTable, but there is no verification that already exists in the database.
I want to effectively delete all the elements in the DataTable that exist in the actual database table before passing it to WriteToServer(dt) .
What would be a good performance, cost-effective solution to this problem?
source share