I have a project where I have to make a sales and inventory system. My purchase order form has a table which you can list the products that you want to order. My question is how do I store the products information associated with the purchase order? I thought of doing a bruteforce by adding columns item1, item_desc1, item_qty1 then item2, item_desc2, item_qty2 and so on to the purchase order db table. any help would be appreciated. thank you!
a follow up :D
how do i make a listbox where each index corresponds to a db table. for example, i have a form with a datagrid on the right and a listbox on the left with 3 possible selections: po, si, products. when i click po, it will show me a list of all the po's on the datagrid, when i click si, it'll change to the si's list.
what i did was put 3 oleDBDataAdapter components, configured each to one table and generated a dataset with all 3 tables. then in the code, under the "Private Sub listActions_SelectedIndexChanged i put something like this:
If listActions.SelectedIndex = 0 Then
Dim tableStyle As New DataGridTableStyle
tableStyle.MappingName = "PO"
Dim column As New DataGridTextBoxColumn
column.MappingName = "ponum"
column.HeaderText = "PO No."
column.Width = 40
elseIf listActions.SelectedIndex = 1 Then
'Dim tableStyle2 As New DataGridTableStyle
' tableStyle2.MappingName = "SI"
' Dim column As New DataGridTextBoxColumn
' column.MappingName = "cname"
'column.HeaderText = "Customer"
'column.Width = 40
and so on......
it doesn't seem to work. i get an error at runtime, " The data grid table styles collection already contains a table style with the same mapping name." i think im approaching this the wrong way. anyways, thanks for the help!