Hey, i've had a quick search but couldnt find anything.
Anyway, i have a list of products in a product table. Primary key 'id', and 'Price' is a float
(all variables defined at the top - cut main code out)
I basically want to pull the PRICE from each product ID in the table and assign them to 6 different labels on my form (i have 6 products in the database 1-6) the code above is what i have atm (i was just trying to pull 1 price atm but it just says "SELECT PRICE... etc", in the textbox atm)Code:objConnect = New OleDbConnection objConnect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=|DataDirectory|\Ecommerce.accdb;" objCommand = New OleDbCommand objCommand.Connection = objConnect objConnect.Open() objCommand.CommandType = Data.CommandType.Text objCommand.CommandText = "SELECT Price from Product WHERE ProductID='1'" TextBox1.Text = objCommand.CommandText 'TextBox2.Text = ... objCommand.Parameters.Clear() objCommand.Connection.Close()
Help apprechiated




Reply With Quote
