sherrick123
asked on
Filling a combobox with unique records from dataset
I want to fill in a combobox with unique records from my data set.
ds = New dsBeamProperties
ta = New dsBeamPropertiesTableAdapt ers.tblBea mPropertie sTableAdap ter
ta.Fill(ds.tblBeamProperti es)
Dim i As Integer
i = 0
Dim rf As dsBeamProperties.tblBeamPr opertiesRo w
For Each rf In ds.tblBeamProperties
cboBeamTypes.Items.Add(rf. Type)
Next
ds = New dsBeamProperties
ta = New dsBeamPropertiesTableAdapt
ta.Fill(ds.tblBeamProperti
Dim i As Integer
i = 0
Dim rf As dsBeamProperties.tblBeamPr
For Each rf In ds.tblBeamProperties
cboBeamTypes.Items.Add(rf.
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
'First, instead of declaring rf as the following:
Dim rf As dsBeamProperties.tblBeamPr
'Declare rf as a regular DataRow:
Dim rf As System.Data.DataRow
'Use the ToTable method of the DefaultView for the DataTable, and
' include the "True" parameter for distinct rows, and column names you want returned.
For Each rf In ds.tblBeamProperties.Defau
cboBeamTypes.Items.Add(rf.
Next