This is the assignment:
The database Microland.accdb is maintained by the Microland Computer Warehouse, a mail-order computer-supply company. The tables below show data in the three tables in the database. The table Customers identifies each customer by an ID number and gives, in addition to the name and address, the total amount of purchases during the current year prior to today. The table Inventory identifies each product in stock by an ID number and gives, in addition to its description and price (per unit), the quantity in stock at the beginning of the day. The table Orders gives the orders received today. Assume that it is now the end of the day. Write a Visual Basic program that uses the three tables to do the following two tasks:
1. Display in a listbox the items that are out of stock and those that must be reordered to satisfy todays orders.
2. Display in a listbox bills for all customers who ordered during the day. Each bill should show the customers name, address, items ordered (with costs), and total cost of the order.
Attachment 99491Attachment 99493
Now I'm confused how to do this. How do I query the results in the first place? I've tried (i'm pretty sure I'm doing this wrong in the first place):
Dim Query1 = From inventory In _MICROLAND_1_DataSet.Inventory
Where inventory.quantity <= 5
Select inventory.itemID, inventory.quantity, inventory.description
lstBox.DataSource = Query1.ToList
lstBox.SelectedItem = Nothing
But I get the error: reference to an non-shared member requires an object reference for the MICROLAND_1_DataSet line.
Secondly after I get the query results, how would get results for how many items we need to reorder? Would I do a equation? I'm lost...
The database Microland.accdb is maintained by the Microland Computer Warehouse, a mail-order computer-supply company. The tables below show data in the three tables in the database. The table Customers identifies each customer by an ID number and gives, in addition to the name and address, the total amount of purchases during the current year prior to today. The table Inventory identifies each product in stock by an ID number and gives, in addition to its description and price (per unit), the quantity in stock at the beginning of the day. The table Orders gives the orders received today. Assume that it is now the end of the day. Write a Visual Basic program that uses the three tables to do the following two tasks:
1. Display in a listbox the items that are out of stock and those that must be reordered to satisfy todays orders.
2. Display in a listbox bills for all customers who ordered during the day. Each bill should show the customers name, address, items ordered (with costs), and total cost of the order.
Attachment 99491Attachment 99493
Now I'm confused how to do this. How do I query the results in the first place? I've tried (i'm pretty sure I'm doing this wrong in the first place):
Dim Query1 = From inventory In _MICROLAND_1_DataSet.Inventory
Where inventory.quantity <= 5
Select inventory.itemID, inventory.quantity, inventory.description
lstBox.DataSource = Query1.ToList
lstBox.SelectedItem = Nothing
But I get the error: reference to an non-shared member requires an object reference for the MICROLAND_1_DataSet line.
Secondly after I get the query results, how would get results for how many items we need to reorder? Would I do a equation? I'm lost...