Remove Duplicates in Datatable
-
I have a various tables which gets activated as a user selects an option.I want to poulate the results in a datatable and check they are not duplicate data from each table.My datatable should contain a dataonly once no duplicates. How do i go about that? Is there a function that checks the data before writing it to datatable so that it cant duplicate? Please advice Thanks and regards
-
I have a various tables which gets activated as a user selects an option.I want to poulate the results in a datatable and check they are not duplicate data from each table.My datatable should contain a dataonly once no duplicates. How do i go about that? Is there a function that checks the data before writing it to datatable so that it cant duplicate? Please advice Thanks and regards
Not really, your database should have keys set so that it won't accept duplicates. The other way is to write a select to see if the data exists. Finally, you can insert with a stored proc that first checks if the data exists, and only inserts if it doesn't.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I have a various tables which gets activated as a user selects an option.I want to poulate the results in a datatable and check they are not duplicate data from each table.My datatable should contain a dataonly once no duplicates. How do i go about that? Is there a function that checks the data before writing it to datatable so that it cant duplicate? Please advice Thanks and regards
Every table must have primary key and the Domain of each column must matches with one another to get the correct type of data in a column of the datatable.Load 1st row from i(Option selected) table to common datatable, check whether that rows is exists in common datatble,if it is then dont add the row else add them and proceed further with next row in i table.:rose:
Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)
-
Every table must have primary key and the Domain of each column must matches with one another to get the correct type of data in a column of the datatable.Load 1st row from i(Option selected) table to common datatable, check whether that rows is exists in common datatble,if it is then dont add the row else add them and proceed further with next row in i table.:rose:
Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)
-
I have a various tables which gets activated as a user selects an option.I want to poulate the results in a datatable and check they are not duplicate data from each table.My datatable should contain a dataonly once no duplicates. How do i go about that? Is there a function that checks the data before writing it to datatable so that it cant duplicate? Please advice Thanks and regards