I'm trying to retrieve a specific value from the customer account database which has the selected customer ID. I'm not sure how to do this exactly, this is what I have so far.
I will be selecting the customer ID from a combo box, so how exactly will I declare this in my code with SQL?
Dim con As New OleDbConnection 'a new connection for the database is assigned
con.ConnectionString = "Provider =Microsoft.ACE.OLEDB.12.0; data source= C:\Users\Hamza\Documents\POS system1.accdb "
con.Open()
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
cmd = New OleDbCommand("Select Points from customers WHERE CustID= @CustID", con) 'query used to select all field
dr = cmd.ExecuteReader
txtdiscount.Text = Convert.ToInt32(dr)
con.Close()
dr.Read()the reader, or useExecuteScalar.