项目已经投入使用了,但近来出了问题,点击按钮后,本应在将"DemandTable"的数据按照“Canlendar"表的周数添加到"FCST"表中,但报错,提示为system .argumentException: 列“”不属于表DemandTable,代码都没动,以前只变动了数据列的顺序,减少了部分数据列。请帮忙分析查找原因,谢谢!
按钮的代码如下:
DataTables("FCST").DataRows.Clear()
Dim wks As List (Of String) = DataTables("Calendar").GetUniqueValues("","Week")
For Each r As Row In Tables("DemandTable").Rows
For Each wk As String In wks
If r.IsNull(wk) = False Then
Dim dr As DataRow = DataTables("Calendar").Find("Week = '" & wk & "'")
Dim dr0 As DataRow = DataTables("FCST").AddNew()
dr0("DemandDate") = dr("DemandDate")
dr0("StokvisPN") = r("StokvisPN")
dr0("CustomerPN") = r("CustomerPN")
dr0("CustomerCode") = r("CustomerCode")
dr0("PlanQuantity") = r(wk)
End If
Next
Next
Tables("FCST").Sort = "DemandDate"
Tables("DemandTable").Filter = ""
DataTables("FCST").Save()