有一个内部函数。挂在了一个单元格的datarow changed的事件代码里面。
每次运行都会出现下面这个错误,但是表格的计算是OK的。
Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
Dim cmd As new sqlcomand
Dim mosdt,wipdt As DataTable
Dim totalqty As DataRow
cmd.Connec=。。。
cmd.CommandT=。。。
mosdt=cmd.Execeader()
cmd.CommandT=。。。
wipdt=cmd.Execueader()
Dim rmlist,moolist As new List(of DataRow)
Dim molist As new List(of String)
For Each rms As DataRow In rmlist
moolist =mosdt.Select("outputitem='" & rms("料号") & "'")
For Each mos As DataRow In moolist
MessageBox.Show(12)
Dim deldr As DataRow
deldr=wipdt.Find("m")
If deldr IsNot Nothing Then
deldr("leftq")-=mos("qty")*rms("数量")
MessageBox.Show(13)
deldr.save问题出在这里,deldr是属于wipdt的内部临时datatable,为何保存的时候还会出现Update requires a valid UpdateCommand when passed DataRow collection with modified rows.的错误?