0
我試圖執行在vb.net窗口此查詢窗體應用程序始終從MS Access數據庫vb.net返回空值
select SUM(Amount)
from FeesRecord
where [email protected]
AND Batch_Id=(select Batch_Id from Admissions where [email protected])
AND ReExam_Id IS NULL)
我設置參數正確的價值觀,但我一直都想與空的結果在executioncaler中。
我的代碼
cmd.CommandText = "select SUM(Amount) from FeesRecord where ([email protected] AND Batch_Id=(select Batch_Id from Admissions where [email protected]) AND ReExam_Id IS NULL)"
cmd.Parameters.AddWithValue("@p1", txtregno.Text)
cmd.Parameters.AddWithValue("@p2", gv1.Rows(i).Cells(0).Value.ToString)
MsgBox(cmd.ExecuteScalar.ToString)
您能否提供您使用的參數值以及表中包含的與這些值相關的數據? – trincot