G
Graeme Richardson
Hi, two tables with one-to-none,one or many relational integrity enforced.
I've populated a combobox using an ArrayList object
Dim strSQL As String = "SELECT uidSampleArea, SampleArea FROM tlkpSampleArea
ORDER BY SampleArea"
mdsDataSet = mCDatabase.getDataSet(strSQL)
Dim al As ArrayList = New ArrayList
al.Add(New clsSampleArea)
Dim dt As DataTable = mdsDataSet.Tables(0)
For Each dr As DataRow In dt.Rows
al.Add(New clsSampleArea(dr))
Next
' Fill ComboBox
rcboComboBox.Items.Clear() ' Remove history
rcboComboBox.DataSource = al
rcboComboBox.ValueMember = "uidSampleArea" ' String field
rcboComboBox.DisplayMember = "SampleArea" ' String field
How should I populate a combobox to have a Null value at the top of the list
(rather than zero length string)?
Alternatively, is there a better way to do this?
Thanks, Graeme.
I've populated a combobox using an ArrayList object
Dim strSQL As String = "SELECT uidSampleArea, SampleArea FROM tlkpSampleArea
ORDER BY SampleArea"
mdsDataSet = mCDatabase.getDataSet(strSQL)
Dim al As ArrayList = New ArrayList
al.Add(New clsSampleArea)
Dim dt As DataTable = mdsDataSet.Tables(0)
For Each dr As DataRow In dt.Rows
al.Add(New clsSampleArea(dr))
Next
' Fill ComboBox
rcboComboBox.Items.Clear() ' Remove history
rcboComboBox.DataSource = al
rcboComboBox.ValueMember = "uidSampleArea" ' String field
rcboComboBox.DisplayMember = "SampleArea" ' String field
How should I populate a combobox to have a Null value at the top of the list
(rather than zero length string)?
Alternatively, is there a better way to do this?
Thanks, Graeme.