cschristian78
Technical User
I have a group of results in a sql database (in one table named [zz_Results Master]. This table has mulitple colums - in particular [Set] and [Type]. The set is a user defined name that describes a set of sql queries. The type describes what type of queries were run. So for example, I will have a set named Set1 in the [Set] field and then I may have many types of queries such as State, County, Countries, etc. Each query will list the number of locations and sum the values. I am creating a results viewer so that the user can see results based on the set and type of queries. The problem is that when I set the combo box that lists the types of queries, it contains duplicate values. For example, when selecing the combo box, I might have the following:
State
State
Country
County
County
County...etc. Is there a way to group the "DisplayMember" property? Here is the code below.
Private Sub btnLP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLP.Click
daResults.SelectCommand = New SqlClient.SqlCommand("Select * from [zz_Results Master]", ProfDataCon)
Try
daResults.Fill(dsResults, "dtLP")
cmbProfile.DataSource = dsResults.Tables("dtLP")
cmbProfile.DisplayMember = "Type".ToString
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
State
State
Country
County
County
County...etc. Is there a way to group the "DisplayMember" property? Here is the code below.
Private Sub btnLP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLP.Click
daResults.SelectCommand = New SqlClient.SqlCommand("Select * from [zz_Results Master]", ProfDataCon)
Try
daResults.Fill(dsResults, "dtLP")
cmbProfile.DataSource = dsResults.Tables("dtLP")
cmbProfile.DisplayMember = "Type".ToString
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub