Home > Database > Mysql Tutorial > 该行已经属于另一个表 的解决方法

该行已经属于另一个表 的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:57:37
Original
1180 people have browsed it

今天在将内存表的数据复制到另外一个内存表的时候,出现了一个错误:(C#)

DataTable dt = new DataTable();
dt = ds.Tables["All"].Clone();//把All的结构传递给dt
DataRow[] dr=this.dataSet31.Tables["Product"].Select("bc=1");
for(int i=0;i{
//将数组元素加入表
dt.Rows.Add(dr[i]);//出错提示为:该行已经属于另一个表
}
//解决方法
dt.Rows.Add(dr[i].ItemArray);
//这样就好了!
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template