Click here to Skip to main content
12,816,270 members (32,771 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET

I want to create table for invoice. Columns will be Item, Brand, Specification these are in combobox and Quantity, Price and Total Price are in Textbox. I have to create this in table like datagridview. Please help me to do this.

Thanks in Advance
Posted 23-Jan-13 22:04pm
__BrokenArrow__ 24-Jan-13 3:38am
Do you mean to put the data in a Listview?
jibesh 24-Jan-13 3:43am
what do you mean by Table here ? was it a different user Control? your question is not clear. can you elaborate your question. You can use the 'improve question' link to update your question.
__BrokenArrow__ 24-Jan-13 3:44am
Do you want to add the data to a dataset then create a datatable or do you want to add the data from the comboboxes to a listview control and then update the datatable or update the database directly?
Jayanthi-SE 24-Jan-13 3:46am
s i want to add comboboxes and textbox. i didnt use listview control. so i cant tell u exactly. can you explain that please
__BrokenArrow__ 24-Jan-13 3:56am
If you are using let's say an access database you can update the database table like this usin an sql statement an oledb.

Imports System.Data
Imports System.Data.OleDb

Public claas1

Private dbpath As String = "Location of database"
Private dbx1 As String = "Database Password"
Private m_conn As OleDbConnection
Private con_str As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbpath & ";Persist Security Info=True;Jet OLEDB:Database Password=" & dbx1

' You can Add as many comboboxes or textboxes as you require

Public Sub SaveData(ByVal cbo1 As Combobox, ByVal cbo2 As As Combobox)
m_conn = New OleDbConnection(con_str)

Dim strInsertSql As String = "Insert Into [tblUsers]([Username], [Password])Values('" & cbo1.text & "','" & cbo2.text & "')"

Dim cmd As New OleDbCommand(strInsertSql, m_conn)



Catch ex As Exception
MessageBox.Show(ex.Message & ex.StackTrace)
End Try
End Sub

If this is not what you require please let me know
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If You need not to Remember Data After Submitting Invoice or After Exiting Application, then You may Use 2 Dimensional Array...
Rate this: bad
Please Sign up or sign in to vote.

Solution 4


Might i understand your problem. You want to add a new row on [+] button click in your table looking set of control(I mean Combo box and Text boxes).

There are several approach of doing this.
1. The most common way is use Datagridview. you can add Combo box in first column and text box in another columns.
2. You can add dynamic controls in TableLayout control on click of [+] button.

3. You can design you own coustom control which has these set of control and add this control on you form on click of [+].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100