Trying to get distinct values using datatable.select

bmanferlife

New Member
I am trying to get data from xml file and then filter using datatable.Select() to adding the values in combobox.But I am getting duplicate values, so I need to apply DISTINCT sort. Tried dt1.DefaultView.ToTable but no luck. still its adding duplicate items also in combobox. below is the code snippet which I am using:\[code\] DataTable dt1 = XMLCategory.ds.Tables["AgencyInfo"]; DataRow[] foundRows; foundRows = dt1.Select("AgencyRegion='" + cmbAgPr_Region.Text + "'"); DataTable dt2 = dt1.DefaultView.ToTable(true, "AgencyMarket"); for (int i = 0; i < foundRows.Length; i++) { cmbAgPr_Market.Items.Add(foundRows[1]); }\[/code\]Any help..
 
Back
Top