Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim adapter As New SqlDataAdapter() Dim ds As New DataSet() Dim con As New SqlConnection("Data Source=.;Initial Catalog=system saling;Integrated Security=True") Try If IsNumeric(ComboBox1.SelectedValue) Then Dim com As New SqlCommand("select id_col,collection_name from colec_items where (card_no = '" & ComboBox1.SelectedValue & "')", con) con.Open() adapter.SelectCommand = com adapter.Fill(ds) adapter.Dispose() com.Dispose() con.Close() ComboBox2.DataSource = ds.Tables(0) ComboBox2.ValueMember = "id_col" ComboBox2.DisplayMember = "collection_name" End If Catch ex As Exception 'MessageBox.Show("errogggggggggggggvgr") End Try End Sub
Private Sub ComboBox2_SelectedValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedValueChanged Dim adapter As New SqlDataAdapter() Dim ds As New DataSet() Dim con As New SqlConnection("Data Source=.;Initial Catalog=system saling;Integrated Security=True") Try If IsNumeric(ComboBox2.SelectedValue) Then Dim com As New SqlCommand("select item_no,item_name from item_info where (collec_no = '" + ComboBox2.SelectedValue + "')", con) con.Open() adapter.SelectCommand = com adapter.Fill(ds) adapter.Dispose() com.Dispose() con.Close() ComboBox3.DataSource = ds.Tables(0) ComboBox3.ValueMember = "item_no" ComboBox3.DisplayMember = "item_name" End If Catch ex As Exception End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)