K
Kelvin
Hi All,
I have to the following problem on add new row into existing DataTable
while the DataTable Looping.
for (i=0; myTable.Rows.Count > i ; i++ )
{
DataRow dataRow = myTable.Rows;
dataRow["Stockroom"] = "";
dataRow["CurrencyCode"] = "";
dataRow["TotalPrice"] = mySubTotal;
myTable.Rows.Add(dataRow); <------
}
DetailGrid.DataSource = myTable;
It display the following error message :
"Exception Details: System.ArgumentException: This row already belongs
to this table."
I have to the following problem on add new row into existing DataTable
while the DataTable Looping.
for (i=0; myTable.Rows.Count > i ; i++ )
{
DataRow dataRow = myTable.Rows;
dataRow["Stockroom"] = "";
dataRow["CurrencyCode"] = "";
dataRow["TotalPrice"] = mySubTotal;
myTable.Rows.Add(dataRow); <------
}
DetailGrid.DataSource = myTable;
It display the following error message :
"Exception Details: System.ArgumentException: This row already belongs
to this table."