该行已经属于另一个表 的解决方法
时间:2024-01-26 05:15:32
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<dr.Length;i++)
{
//将数组元素加入表
dt.Rows.Add(dr[i]);//出错提示为:该行已经属于另一个表
}
//解决方法
dt.Rows.Add(dr[i].ItemArray);
//这样就好了!
标签:已经属于另一个表
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
JavaScript实现点击出现子菜单效果
2024-04-19 10:45:56
![](https://img.aspxhome.com/file/2023/6/135776_0s.jpg)
Javascript浅拷贝与深拷贝实现
2013-07-16 22:47:46
MySQL 创建多对多和一对一关系方法
2024-01-29 07:52:37
![](https://img.aspxhome.com/file/2023/9/116799_0s.png)
python内置函数sorted()用法深入分析
2022-06-26 07:41:40
numpy array找出符合条件的数并赋值的示例代码
2021-07-03 05:01:38
如何基于Python按行合并两个txt
2021-03-19 08:24:41
![](https://img.aspxhome.com/file/2023/5/104905_0s.png)
Python+selenium实现截图图片并保存截取的图片
2023-06-03 10:15:59
15款非常有用的前端开发CSS网格(grid system)生成器
2009-07-06 13:02:00
![](https://img.aspxhome.com/file/UploadPic/20097/6/grid-layout-generator-by-pagecolumn-14s.jpg)
python中利用numpy.array()实现俩个数值列表的对应相加方法
2022-08-26 01:49:25
Python中一些深不见底的“坑”
2021-10-10 05:03:57
Python + Tkinter连接本地MySQL数据库简单实现注册登录
2023-04-24 22:07:07
![](https://img.aspxhome.com/file/2023/0/68330_0s.png)
[译文]The seven rules of Unobtrusive JavaScript
2008-09-29 12:10:00
Python Flask 模型介绍和配置方法
2023-07-15 21:00:41
![](https://img.aspxhome.com/file/2023/0/92130_0s.png)
SQL窗口函数之取值窗口函数的使用
2024-01-27 06:53:37
![](https://img.aspxhome.com/file/2023/5/129295_0s.png)
Pytorch Tensor的索引与切片例子
2022-12-08 16:28:10
如何使用Python实现一个简易的ORM模型
2021-05-18 19:24:46
Python Opencv 通过轨迹(跟踪)栏实现更改整张图像的背景颜色
2021-12-03 04:04:53
![](https://img.aspxhome.com/file/2023/7/92457_0s.png)
Python编程实现简单的微博自动点赞
2021-05-14 06:43:12
![](https://img.aspxhome.com/file/2023/4/128204_0s.jpg)
Python Django框架模板渲染功能示例
2023-03-12 17:39:03
![](https://img.aspxhome.com/file/2023/3/84103_0s.png)
DreamweaverMX 2004打造细线表格
2008-10-01 09:39:00