distinct selection in a dataview

  • Thread starter Thread starter Diego Rojas
  • Start date Start date
D

Diego Rojas

How can i get a dataview of a table, saiyng that i want
to select the rows by a column y a distinct way
for example i want to create a dataview of el the
countries in a table, so a wna t to get yous the distinc
value for the field country?
txs
 
You can declare a new dataview and set it to someDataTable.DefaultView

DataView dv = new DataView(dt.DefaultView);

from there, adjust the rowfilter based on country ie

dv.RowFilter = "Country = USA". If you are dynamically setting the filter,
just concenate it with your filter is "Country = " + someVariable;

Cheers,

Bill
 
Back
Top