Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


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
Comments
__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)

Try
m_conn.Open()

cmd.ExecuteNonQuery

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

If this is not what you require please let me know

If You need not to Remember Data After Submitting Invoice or After Exiting Application, then You may Use 2 Dimensional Array...
 
Share this answer
 
Hi,

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 [+].



RKS
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900