B
Brett Romero
I keep getting this error with the following code:
This row already belongs to another table
DataSet ds = new DataSet();
DataTable dtPersonID = new DataTable();
dtPersonID.Columns.Add("PersonID");
foreach (DataRow dr in dt.Rows)
{
dtPersonID.Rows.Add(dr);
}
Why does it matter if two tables have the same row? This is my first
pass through the app so dtPersonID does not have any rows. I'm
transferring the PersonID column from the dt table into dtPersonID.
Thanks,
Brett
This row already belongs to another table
DataSet ds = new DataSet();
DataTable dtPersonID = new DataTable();
dtPersonID.Columns.Add("PersonID");
foreach (DataRow dr in dt.Rows)
{
dtPersonID.Rows.Add(dr);
}
Why does it matter if two tables have the same row? This is my first
pass through the app so dtPersonID does not have any rows. I'm
transferring the PersonID column from the dt table into dtPersonID.
Thanks,
Brett