目的:克隆一份新的数据,包含子表的所有行,原始数据保持不变
父表的名称是唯一的,即禁止重复
用下面的代码生成新的父表数据,原父表将无数据,其所有子表数据将关联到新父表中,即:""& str &"_复件" 中,请求帮助:
Dim str As String = Tables("订单").Current("名称")
Tables("订单").Current.Clone()
Tables("订单).Current("名称") = ""& str &"_复件"
Dim drs As List(Of DataRow)
drs = Tables("订单").Current.DataRow.GetChildRows("订单明细")
For Each dr As DataRow In drs
dr.Clone
Next