Tuesday, May 11, 2010
Run time filtering of the records Using Select Expression in DataSet Or in DataTable.
This code is used to write the filter expression in the Dataset runtime.
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string expression = "Id = " + ds.Tables[0].Rows[i][0];
DataRow[] rows = ds.Tables[1].Select(expression);
foreach (DataRow row in rows)
{
DataRow newRow = myDescripterValueTable.Tables[i].NewRow();
newRow["Id"] = row["Id"];
newRow["value"] = row["value"];
myDescripterValueTable.Tables[i].Rows.Add(newRow);
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment