DataTable Select method gets an array of all DataRow objects that match the filter criteria.
If the column on the filter contains a null value, it will not be part of the result.
Example:
private void FilterDataTable(string filter)
{
DataTable table = DataSet1.Tables["Person"];
DataRow[] foundRows;
// Use the Select method to find all rows matching the filter. Sample: filter = "name = 'dan' "
foundRows = table.Select(expression);
for(int i = 0; i < foundRows.Length; i ++)
{
Console.WriteLine(foundRows[i][0] );
}
}
luni, 25 august 2014
Abonați-vă la:
Postare comentarii (Atom)
Niciun comentariu:
Trimiteți un comentariu