Tuesday, 27 April 2010

Get distinct rows from DataTable

Found a method in data table object to get distinct rows:

DataTable dtTest = dtProduct.DefaultView.ToTable(true, new string[] { "PRODUCT", "NATURE", "TYPE" });

The first parameter has to be 'true' to get distinct rows, the second is the list of columns to return.

Cheers.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.