Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True")
Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT * FROM a1_bustype where bustype=" & DropDownList1.SelectedItem.Text.ToString, SQLData)
SQLData.Open()
Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader()
If dtrReader.HasRows Then
While dtrReader.Read()
TextBox1.Text = dtrReader("buscode")
End While
End If
dtrReader.Close()
SQLData.Close()
End Sub
I have following entry in database tabel ...in bustype column i have ..A/c seater volvo and bus code is S41
when i run the webpage it shows the following error invalid column name 'A'