I have a table name
flight_info (flight_id, flight_no, depart_from, destination, depart_time, arrive_time)
Now I want to retrieve only
flight_id on the basis of column depart_from and destination
I wrote the SQL as following:
string str = "SELECT fligth_id FROM flight_info WHERE depart_from = @depart AND destination = @destination"
While running, it's showing an error pointing @depart
and @destination
.
Can you help me, How can I specify those scalar variable.?
I tried it..
SqlDataReader myReader;
string depart = myReader["depart_from"].ToString();
string destination = myReader["destination"].ToString();
But, it's not working. Help needed.