G
Guest
Hi,
I have a DataTable and I want to get a subset of the rows within it. I use
the Select method to get my subset and the results are in a DataRow[]. I
want to put those Rows back into a DataTable. I've tried a few variations of
the following but no rows are every imported into the datatable:
DataRow[] datrow = ds.Tables[0].Select("PersonID = " + id);
DataTable dt = new DataTable();
foreach(DataRow dr in datrow)
{
dt .ImportRow(dr);
}
The DataTable dt always winds up with a count of zero and I know the
DataRow[] datrow has several rows in it. Any thoughts?
Thanks in advance,
Pete
I have a DataTable and I want to get a subset of the rows within it. I use
the Select method to get my subset and the results are in a DataRow[]. I
want to put those Rows back into a DataTable. I've tried a few variations of
the following but no rows are every imported into the datatable:
DataRow[] datrow = ds.Tables[0].Select("PersonID = " + id);
DataTable dt = new DataTable();
foreach(DataRow dr in datrow)
{
dt .ImportRow(dr);
}
The DataTable dt always winds up with a count of zero and I know the
DataRow[] datrow has several rows in it. Any thoughts?
Thanks in advance,
Pete