从字符串到类型LONG转换无效。
麻烦老师帮看下,下面的代码错在哪里?在SELECT哪里,光一个条件的时候没有问题,加了2个条件,出现这个问题。谢谢
Dim str1 As String = e.Form.Controls("ComboBox4").Value
Dim str As String = e.Form.Controls("ComboBox9").Value
Dim fee As Double
fee = DataTables("stock").Compute("sum(stock_storage)", "batchno = '" & str & "'")
Dim qty As Double
qty = DataTables("stock").Compute("sum(stock_qty)", "batchno = '" & str & "'")
Dim nms As List(Of DataRow)
nms = DataTables("sales").Select("salesinvoiceno = '" & str1 & "'" And "salesbatchno = '" & str & "'")
For Each nm As DataRow In nms
nm("storage") = val(nm("salesqty"))*fee/(qty+val(nm("salesqty")))
DataTables("stock").ReplaceFor("stock_storage", fee - nm("storage"),"batchno = '" & str & "'")
Next