Hi There,
I am trying to get the Sum values of a Column and want to check if entered value in Textbox is valid.
Here is my code below
mystr = ("Provider=Microsoft.JET.OLEDB.4.0;" & _
"Data Source=K:\Amrut Diary\Amrut_Diary\ADDB.mdb")
con = New OleDb.OleDbConnection(mystr)
con.Open()
strsql = "SELECT SUM(Available_Stock) As Avstk FROM STOCKDB Where Material_Name= '" & TMtNm.Text & "'"
Dim cmd As New OleDbCommand(strsql, con)
Dim reader As OleDbDataReader = cmd.ExecuteReader
cmd.ExecuteReader()
If TQty.Text > reader("Avstk") Then
MsgBox("Quantity Overflow")
TQty.Text = ""
TQty.Focus()
End If
When I execute, I am Getting "No value given for one or more required parameters." Error