T
Timothy Parez
Hi,
This is part of the code
DataTable y = new DataTable("newData");
int rowCount = destData.Tables[0].Rows.Count;
for (int i = (rowCount - 1);i >=0; i--)
{
DataRow newRow = destData.Tables[0].Rows;
destData.Tables[0].Rows.RemoveAt(i);
y.Rows.Add(newRow); //---------------> Throws an exception, saying the
row already belongs to another table.
}
Same result:
for (int i = (rowCount - 1);i >=0; i--)
{
DataRow newRow = destData.Tables[0].Rows;
destData.Tables[0].Rows.Remove(newRow);
y.Rows.Add(newRow);
}
How can I solve this
This is part of the code
DataTable y = new DataTable("newData");
int rowCount = destData.Tables[0].Rows.Count;
for (int i = (rowCount - 1);i >=0; i--)
{
DataRow newRow = destData.Tables[0].Rows;
destData.Tables[0].Rows.RemoveAt(i);
y.Rows.Add(newRow); //---------------> Throws an exception, saying the
row already belongs to another table.
}
Same result:
for (int i = (rowCount - 1);i >=0; i--)
{
DataRow newRow = destData.Tables[0].Rows;
destData.Tables[0].Rows.Remove(newRow);
y.Rows.Add(newRow);
}
How can I solve this