小编lak*_*han的帖子

ExecuteNonQuery always returns -1 even when the SQL statement is correct

I'm using the following function to calculate sum qty value of given item code(VB.NET, SQL Server, SQL). I do not get any errors but the returned value by the function is always -1. The data is available in the table(Screenshot attached). I think, something is missing in my code but cant figure it out. Any advice will be highly appreciated.

Public Function findPurchaseQty(ByVal itCode As String, ByVal fromDate As DateTime, toDate As DateTime) As Double
    Dim sql = "SELECT …
Run Code Online (Sandbox Code Playgroud)

sql vb.net sql-server executenonquery

2
推荐指数
1
解决办法
73
查看次数

标签 统计

executenonquery ×1

sql ×1

sql-server ×1

vb.net ×1