Main Issue
I have a listbox that I am dynamically populating but I cant seem to add a value to the items.. the code is below
Small Issue
also it would be nice to put both these tables into 1 dataset instead of the 2 I am using
Thanks!!
I have a listbox that I am dynamically populating but I cant seem to add a value to the items.. the code is below
Small Issue
also it would be nice to put both these tables into 1 dataset instead of the 2 I am using
Thanks!!
VB.NET:
'fill dataset with dupont and lanxess tables
Dim da As OleDbDataAdapter = New OleDbDataAdapter("SELECT hostname, Transmitnum, recid, transtype, workordernum, aptmntdate, aptmnttime, location, state, Orderrefnum, PlantRefnum, apptreas, status FROM tbldriver", cn)
Dim la As OleDbDataAdapter = New OleDbDataAdapter("Select '2', Wrkordrnum, aptmntdate, aptmnttime, refnum, tanknum, billdngnum, ontime, shipper, shppraddr, shpprcty, shpprst, shpprzip, consgnee, consgnaddr, consgncty, consgnst, consgnzip, shpstatus, recid From tbllogistics", cn)
Table0 = "dupont"
Table1 = "lanxess"
da.Fill(ds, Table0)
la.Fill(ds, Table1)
'loop through the dataset and populate the listbox1 with TransmitNum & Location cwf 4-19-09
If ds.Tables(0).Rows.Count > 0 Then
Dim i As Integer = 0
For IntCounter = 0 To ds.Tables("dupont").Rows.Count - 1
varAlpha = ""
varAlpha = ds.Tables(Table0).Rows(i).Item(1).ToString() & ", " & ds.Tables(Table0).Rows(i).Item(7).ToString()
ListBox1.Items.Add(UCase(varAlpha))
i = i + 1
Next IntCounter
End If
If ds.Tables(1).Rows.Count > 0 Then
Dim i As Integer = 0
For IntCounter = 0 To ds.Tables("lanxess").Rows.Count - 1
varAlpha2 = ""
varAlpha2 = ds.Tables(Table1).Rows(i).Item(4).ToString() & ", " & ds.Tables(Table1).Rows(i).Item(15).ToString()
ListBox1.Items.Add(UCase(varAlpha2))
i = i + 1
Next IntCounter
End If
Last edited: