need help with tables

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 18
Reputation: reyhan12 is an unknown quantity at this point 
Solved Threads: 0
reyhan12 reyhan12 is offline Offline
Newbie Poster

need help with tables

 
0
  #1
Aug 3rd, 2005
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!
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 18
Reputation: reyhan12 is an unknown quantity at this point 
Solved Threads: 0
reyhan12 reyhan12 is offline Offline
Newbie Poster

Re: need help with tables

 
0
  #2
Aug 3rd, 2005
a follow up
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
Me.OleDbDataAdapter2.Fill(Me.DataSet11)
Dim tableStyle As New DataGridTableStyle
tableStyle.MappingName = "PO"
Dim column As New DataGridTextBoxColumn
column.MappingName = "ponum"
column.HeaderText = "PO No."
column.Width = 40
tableStyle.GridColumnStyles.Add(column)
Me.DataGrid1.TableStyles.Add(tableStyle)
elseIf listActions.SelectedIndex = 1 Then
' Me.OleDbDataAdapter1.Fill(Me.DataSet11)
'Dim tableStyle2 As New DataGridTableStyle
' tableStyle2.MappingName = "SI"
' Dim column As New DataGridTextBoxColumn
' column.MappingName = "cname"
'column.HeaderText = "Customer"
'column.Width = 40
tableStyle2.GridColumnStyles.Add(column)
Me.DataGrid1.TableStyles.Add(tableStyle2)
and so on......
EndIf

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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC