Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for Duplicates in Dataview
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01128261
Message ID:
01128287
Views:
17
Hi, Riyaz...

If you're using VS2005, there's a method for the DataView object called ToTable, that allows you to convert the DV back to the datatable. One of the overloads for ToTable allows you to filter distinctively on duplicate rows.

As a simple example...suppose you have a flat file of thousands of invoices. You want to get a distinct list of the names from that table...
bool lFilterDistinct = true;
DataTable dtUniqueNames = dtInvoices.DefaultView.ToTable(lFilterDistinct,"FirstName,"LastName");
If you're using VS2003, you'll either have to write something to do it manually....or go back to the back-end database and do some kind of SELECT DISTINCT.

Hope that helps...
Kevin


Previous
Reply
Map
View

Click here to load this message in the networking platform