Retrieving data for multiple records

Manny123

Member
Joined
Mar 6, 2012
Messages
16
Programming Experience
Beginner

Dim cmd2 As New OleDbCommand("SELECT Product_name FROM Products WHERE Quantity <= 5 ", cn)

sdr2 = cmd2.ExecuteReader

If sdr2.HasRows Then
    While sdr2.Read
        LstOrders.Items.Add(sdr2("Product_name"))
    End While
End If

This code outputs all the products in a list box which are below a quantity of 5, however for those products i wud also like to retrieve the maximum stock level which was assigned to all of them, calculate how much more is needed to fulfill the maximum stock level and display it next to the product name.

maximun stock level field = Max_Stock_Level

Any ideas?
 
Back
Top