Response to: How to copy one datatable to another
Revision 1
You may use this code for your task.
DataTable dtTarget = new DataTable();
dtTarget = dtSource.Clone();
DataRow[] rowsToCopy;
rowsToCopy = dtSource.Select("key='" + matchString + "'");
foreach (DataRow temp in rowsToCopy)
{
dtTarget.ImportRow(temp);
}
Posted 2-Nov-12 21:08pm
by
subhajit Giri.