First il explain my program a little
I have 2 checked listboxes, 1 for customers and 1 for goods, i also have a textbox which i need to fill in the quantity of goods that customer needs ordered
When i have checked 1 customer, and a item and quantity i have a button that is called make invoice, when this is pressed, a invoice should be made with the information from the checked listboxes in a database called invoice (SQL)
The code i think has a good start is below, but im stuck, i have a hard time figuring out how to go on, im struggling with the understanding from here, please help me.
Dim choicecustomer As System.Windows.Forms.CheckedListBox.CheckedItemCollection = Me.chdlistkunde.CheckedItems
Dim choicegoods As System.Windows.Forms.CheckedListBox.CheckedItemCollection = Me.chkdlistvare.CheckedItems
Dim SQLsentence As String
Dim drv As DataRowView
For Each drv In choicecustomer
Dim customerfname As String = drv.Item("csm_fname")
Dim customerlname As String = drv.Item("csm_lname")
Dim customeradress As String = drv.Item("csm_adress")
Dim customerpostnr As Integer = drv.Item("post_nr")
'Need to place values from the goods listbox too, im stuck here :(
'sqlsentence = insert into order values(â€ & kundeid & â€,â€ & k â€¦.. )??? please help me
'Run command against database here i guess?