这是在一个 asp.net 应用程序中
我有这个例外
System.OverflowException: Arithmetic operation resulted in an overflow
。但奇怪的是,当调用函数并返回结果时,此错误似乎浮出水面,但如果我直接编写函数代码而不是通过函数,只需将其写在代码下方,它不会产生此错误,请帮助这里是编码
Dim MyItem As New Item
If MyItem.GetQtyInBin(bran_code.Text, itcode.Text, binloc.Text) <= 0 Then
...............
Exit Sub
这是方法的代码
'this method gets the qty of a certain item in a certainn location and returns it
Public Function GetQtyInBin(ByVal Branch As String, ByVal Item As Integer, ByVal Bin As String) As Integer
cn = New OleDb.OleDbConnection("provider=msdaora; Data Source=llmw; User Id=xxxx;Password=xxxx")
cmd = New OleDb.OleDbCommand("select Qty from Binprmast where Bin_No='" & Bin & "' and item_Code='" & Item & "' and Bran_Code='" & Branch & "'", cn)
cn.Open()
Dim qty As Double
qty = cmd.ExecuteScalar
Return qty
End Function