Dim Products As List(Of String)
Products = DataTables("登记台账").GetValues("guid")
For Each Product As String In Products
Output.Show(Product)
Dim dr1 As DataRow = DataTables("登记台账汇总表").AddNew
For Each dc As DataCol In DataTables("记台账").DataCols
For Each dr As DataRow In DataTables("登记台账").datarows
dr1(dc.Name) = dr(dc.Name)
Next
Next
dr1.save
Next
当前代码:【将上述正常使用的表用SQL与进行操作时,提示如下错误】
Dim cmd As New SQ LCommand
Dim dt,dt1,dt2 As DataTable
cmd.Conne ction Name = "主数据源"
cmd.Comm andText = "Selec t * From 登记台账"
Dim dt111 As DataTable = cmd.ExecuteReader()
cmd.CommandText = "Sele ct * From 登记台账汇总表"
Dim dt112 As DataTable = cmd.ExecuteReader()
Dim Products As List(Of String)
Products = dt111.GetValues("guid")
For Each Product As String In Products
Output.Show(Product)
Dim dr1 As DataRow = dt112.AddNew
For Each dc As DataCol In dt111.DataCols
For Each dr As DataRow In dt111.datarows
dr1(dc.Name) = dr(dc.Name)
Next
Next
dr1.save
Next
错误的事件名称
System.InvalidOperationException: 当传递具有新行的 DataRow 集合时,Update 要求有效的 InsertCommand。
2022-12-07 16:33:09