表 ds
| ID | name |
| 1 | 张飞 |
| 2 | 关羽 |
表 ds2
| ID | name |
| 1 | 刘备 |
1、
ds.Tables[0].Merge(ds2.Tables[0]);
2、
if (ds2.Tables[0].Rows.Count > 0)
{
foreach (DataRow dr in ds2.Tables[0].Rows)
{
ds.Tables[0].ImportRow(dr);
}
}
合并后 ds
| ID | name |
| 1 | 张飞 |
| 2 | 关羽 |
| 1 | 刘备 |