Wednesday, April 6, 2011

select Multiple distinct coulmns from DataTable to Datarow Collection

DataTable dtCompany=new DataTable();
DataRow drComp;
IEnumerable<DataRow> drColl= dtCompany.AsEnumerable();
var v = (from s in drColl
             select new
            {
                   Country = s.Field<string>("Country"),
                   Province = s.Field<string>("Company State/Province")
            }) .Distinct().ToArray();

No comments:

Post a Comment