Q:

What's wrong in my this SQL Server 2005 query?

On Error Resume Next
        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_ticket WHERE ITC =A1/1007", SQLData)
        SQLData.Open()
        Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader()
        If dtrReader.HasRows Then
            While dtrReader.Read()
                Literal1.Text = ""
                Literal3.Text = "A1/1008"
                Literal4.Text = dtrReader("Travels")
                Literal5.Text = dtrReader("name")
                Literal6.Text = dtrReader("mob")
                Literal7.Text = dtrReader("fro_m")
                Literal8.Text = dtrReader("t_o")
                Literal9.Text = dtrReader("book_date")
                Literal10.Text = dtrReader("journey_date")
                Literal11.Text = dtrReader("dep_time")
                Literal12.Text = dtrReader("arr_time")
                Literal13.Text = dtrReader("bd_point")
                Literal14.Text = dtrReader("dp_point")
                Literal15.Text = dtrReader("sel_seat")
                Literal16.Text = dtrReader("seat_opt")
                Literal17.Text = dtrReader("bus_type")
                Literal18.Text = dtrReader("taxes")
                Literal19.Text = ""
                Literal20.Text = ""
                Literal21.Text = ""
            End While
        Else
        End If
        dtrReader.Close()
        SQLData.Close()

A:

Your char/varchar value should be in single quotes. " ..... = 'A1/1007'  "

