Private Sub Combotype_SelectedIndexChanged() Handles Combotype.SelectedIndexChanged
Dim typeID As Integer = GetCategoryID(Combotype.SelectedItem)
sql = "SELECT DISTINCT pro_price FROM Product WHERE pro_id_type =" & typeID
command = New SqlCommand(sql, connection)
adapter = New SqlDataAdapter(command)
datast = New DataSet()
adapter.Fill(datast, "Product")
bindingsrc = New BindingSource()
bindingsrc.DataSource = datast.Tables("Product")
Comboprice.DataSource = datast.Tables("Product")
Comboprice.DisplayMember = "pro_price"
UpdateBinding()
Comboprice.SelectedIndex = 0
End Sub
Private Sub Comboprice_SelectedIndexChanged() Handles Comboprice.SelectedIndexChanged
MessageBox.Show(Comboprice.Text)
End Sub
Tag : .NET, Ms SQL Server 2008, VB.NET, VS 2010 (.NET 4.x)