asp. net solution to indicate that the row already belongs to another table

  • 2020-06-23 00:08:48
  • OfStack


DataTable dt = new DataTable();
dt = ds.Tables["All"].Clone();// cloning All The structure of dt
DataRow[] dr=this.dataSet31.Tables["Product"].Select("bc=1"); // You get the rows that meet the conditions 
for(int i=0;i<dr.Length;i++)
{
// Adds an array element to the table ...
dt.Rows.Add(dr[i]);// Error prompt is : The bank already belongs to another 1 A table 
}


The solution


dt.Rows.Add(dr[i].ItemArray);

Related articles: