Sunday, November 11, 2012

Fetch Distinct Values From Datatable In c#

To Fetch distinct values from already fetched DataTable in Ado.net we can use following method.

DataTable temp = DT.DefaultView.ToTable(true, "ContractId");
//Note here I wanted to fetch Distinct ContractIds from DT
Use Above code to select Distinct values from the Datatable, or Use Above code to fetch distinct values from Ado.Net Datatable or datatable in c#. Submit this story to DotNetKicks

Read more...