K
Kelvin
Hi All,
Please advised. Thanks alot.
y = myTable.Rows.Count;
for (i=0; y > i ; i++ )
{
DataRow dataRow = myTable.Rows; <----If using this syntax, Error
Message: Exception Details: System.ArgumentException: This row already
belongs to this table.
DataRow dataRow = new DataRow(); <---- If using this syntax, I can't
get table column in each row and can't insert row between rows. I have
to calculate total price while datatable looping
if (myOrderNo != (string)dataRow["OrderNo"]) <--- Checking Different
Order No Between Previous and Current Record.
{
dataRow["StyleSize"] = "";
dataRow["Stockroom"] = "";
dataRow["CurrencyCode"] = "";
dataRow["TotalPrice"] = mySubTotal;
myTable.Rows.Add(dataRow); <----- Error Here
myTable.AcceptChanges();
myOrderNo = (string)dataRow["OrderNo"];
}
}
Please advised. Thanks alot.
y = myTable.Rows.Count;
for (i=0; y > i ; i++ )
{
DataRow dataRow = myTable.Rows; <----If using this syntax, Error
Message: Exception Details: System.ArgumentException: This row already
belongs to this table.
DataRow dataRow = new DataRow(); <---- If using this syntax, I can't
get table column in each row and can't insert row between rows. I have
to calculate total price while datatable looping
if (myOrderNo != (string)dataRow["OrderNo"]) <--- Checking Different
Order No Between Previous and Current Record.
{
dataRow["StyleSize"] = "";
dataRow["Stockroom"] = "";
dataRow["CurrencyCode"] = "";
dataRow["TotalPrice"] = mySubTotal;
myTable.Rows.Add(dataRow); <----- Error Here
myTable.AcceptChanges();
myOrderNo = (string)dataRow["OrderNo"];
}
}