DataRelation customerOrdersRelation = customerOrders.Relations.Add("CustOrders", customerOrders.Tables["Customers"].Columns["CustomerID"], customerOrders.Tables["Orders"].Columns["CustomerID"]); DataTable dt=new DataTable(); foreach (DataRow custRow in customerOrders.Tables["Customers"].Rows) { dt.Rows.Add(custRow); // raise error. Line 8 foreach (DataRow orderRow in custRow.GetChildRows(customerOrdersRelation)) { // some code } }
foreach (DataRow dr in dataTable1.Rows) { if (/* some condition */) dataTable2.Rows.Add(dr.ItemArray); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)