Hi,
I have a form with two combobox which is related with each other. All the data is kept in MSSQL database and retrieve using Dataset in VB.net code.
What i want to do when the first user select a value in cb1, cb2 will filtered the data to match the value in cb1. I have tried in many ways but i still couldn't get the result i want.
I've create the SQL syntax inside the datatable as ReturnUnitWt. So inside the code i only call back the SQL.
Eg : cb1 : A, B, C, D
cb2 : AA, AB, BD, BF etc...
I have a form with two combobox which is related with each other. All the data is kept in MSSQL database and retrieve using Dataset in VB.net code.
What i want to do when the first user select a value in cb1, cb2 will filtered the data to match the value in cb1. I have tried in many ways but i still couldn't get the result i want.
I've create the SQL syntax inside the datatable as ReturnUnitWt. So inside the code i only call back the SQL.
Eg : cb1 : A, B, C, D
cb2 : AA, AB, BD, BF etc...
Private Sub cbBilletSize_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbBilletSize.SelectedIndexChanged
If Me.cbBilletSize.SelectedValue > 0 Then
Me.cbUnitWt.SelectedValue = Me.TbCastTableAdapter.ReturnUnitWt(Me.cbBilletSize.SelectedValue)
Else
Me.cbUnitWt.SelectedValue = DBNull.Value
End If
End Sub