Hi Everyone,
I have a database table that have 4 field( C1, C2,
M1, M2) on my form i have two combo box ComboC and ComboM
C1 C2 M1
M2
1 Sales 1
Monthly Terms
1 Sales 2
Annual Terms
1 Sales 3
Yearly Terms
2 Tech 1
Windows
2 Tech 2
Linux
2 Tech 3
Mac
I write a procedure that populate ComboC with a Combine distinct info from
the table(C1 ' ' + ' ' + C2) and When you Select any item from ComboC it
populates ComboM with the List of item in (M1 ' ' + ' ' + M2) in other words
if you select Sales in ComboC it should populate ComboM with Monthly Teems,
Annual Terms and Year Terms
It have the code that populate the comboxC below, I need help with the
procedure that will populate ComboM based on selection of comboxC
Dim mySqlConnection As SqlConnection
mySqlConnection = New
SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings.Get("Co
nnectionString"))
mySqlConnection.Open()
Dim Dt As DataTable
Dim Ds As New DataSet
Dim StrSql As String
StrSql = "SELECT Distinct ClientNumber + ' ' + ' ' + ClientName as
MyClients, ClientNumber as ClientID FROM ClientMatter"
Dim Da As New SqlDataAdapter(StrSql, mySqlConnection)
Da.Fill(Ds)
_dtClient = Ds.Tables(0)
Try
cmbClient.ValueMember = "ClientID"
cmbClient.DisplayMember = "MyClients"
cmbClient.DataSource = _dtClient.DefaultView
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
mySqlConnection.Close()
Thanks
ROO