DataTable trgtDtaTbl = new DataTable();
trgtDtaTbl = srcDtaTbl.Clone();
foreach (DataRow srcDR in srcDtaTbl.Rows)
{
// "if (srcDR is not qualified) continue;"
DataRow tmpDR = trgtDtaTbl.NewRow();
tmpDR.ItemArray = srcDR.ItemArray;
trgtDtaTbl.Rows.Add(tmpDR);
}
DataTable destDtaTbl = new DataTable();
string tmpFltr = srcDtaTbl.DefaultView.RowFilter;
srcDtaTbl.DefaultView.RowFilter = String.Empty;
destDtaTbl = srcDtaTbl.DefaultView.ToTable().Copy();
srcDtaTbl.DefaultView.RowFilter = tmpFltr;
No comments:
Post a Comment