I want to get the relevant name of the product Id into a text box when I select the product id from the combobox
myConnection = New SqlConnection(connectionstring)
myConnection.Open()
myCommand = New SqlCommand(" Select Name FROM [Product_Name_List] Where P_Id='" & ComboBox2.Text & "'", myConnection)
Dim dr As SqlDataReader = myCommand.ExecuteReader
While dr.Read()
TextBox8.Text = Val(dr(0)).ToString
End While
dr.Close()
myConnection.Close()