hello frnds plz help me in my project which is based on vb.net and backend is sql server 2000 I am trying to create a search form i create a form with 2 combobox one for fields and another is for values one datagridview which show the records i have a coding for this but it gives error i paste it: Dim Sql As String Dim Reader As SqlClient.SqlDataReader Dim Category As String = Nothing Dim cmd As SqlCommand cmbvalues.Items.Clear() Sql = "SELECT distinct" & cmbvalues.Text & "FROM Product" cmd = New SqlCommand(Sql, obj.conn) Reader = cmd.ExecuteReader() While Reader.Read() Category = Reader.Item(0).ToString() If Not Category Is Nothing Then cmbvalues.Items.Add(Category) End If End While Reader.Close() cmbvalues.SelectedIndex = 0 this coding is for when i click on combobox fields its values show on combobox values
please copy the error message you get.
Join our real-time social learning platform and learn together with your friends!