I have a table by name assetcategory in database.I need the sum of quantity attribute where Asset_name attribute equal to CPU. After this i want to store the result in a label.
I wrote the following query but its not working.
Dim cmd3 As New OleDbCommand("Select sum(Quantity) from assetcategory where ID ='A013' and Asset_Name='CPU'", con)
Dim dr1 As OleDbDataReader
dr1 = cmd3.ExecuteReader
While dr1.Read
Label4.text=dr1.item(0).Tostring
End While