The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

alphaa2001 (1) [Avatar] Offline
Hi All.

I have Dynamic Datatable and i want to extract Distinct Rows Based on certain number of Columns

Now number of Columns is dynamic

I m using tryingto use LINQ to achieve this

I am using

var distinctRows = (from DataRow dRow in dt.Rows
select new {col1 = dRow["T0"], col2 = dRow["T1"], col3 = dRow["T2"], col4 = dRow["T3"] }).Distinct();

where this Datatable has 4 columns on which i need Distinct query but i need a generic solution where Number of Columns Can be flexible??

Any help??