Posted on: 6/19/2013 4:27:53 AM | Views : 410

Hi,
I have 2 datatables. In the first datatable, i have a column called "Flag". I am trying to import the datatable to another datatable.
However, if the column "Flag" has value as "Delete", then that row should not be copied to the child datatable.
I have tried the ImportRow option, but not sure, how to set the condition. I have used the below code:
//dtParentTableData contains the column called Flag DataTable dtChildTable = new DataTable(); dtChildTable = dtParentTableData.Clone(); foreach (DataRow dr in dtParentTableData.Rows) { dtChildTable.ImportRow(dr); } How to import rows based on the condition?
Thanks
...

Go to the complete details ...