| | |
need help with tables
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jul 2005
Posts: 18
Reputation:
Solved Threads: 0
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!
•
•
Join Date: Jul 2005
Posts: 18
Reputation:
Solved Threads: 0
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!
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!
![]() |
Similar Threads
- Layout Tables to CSS (HTML and CSS)
- Large and tables/cells..how? (HTML and CSS)
- Internal Data Tables (Visual Basic 4 / 5 / 6)
- Loing authentication fields from 2 tables? (ASP)
- web design: tables versus divs (HTML and CSS)
- updating 2 HTML tables on one PHP page (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: thread pooling and synchronization
- Next Thread: Interactive excel web page and vb.net
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account application array basic beginner browser button buttons center check click code combo crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade file-dialog filter forms ftp generatetags hardcopy html images input insert intel listview module monitor net networking number open output panel passingparameters picturebox picturebox2 port print printing problem project regex right-to-left searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey tcp temperature text textbox timespan toolbox transparency trim txttoxmlconverter user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





