Without knowing the tables etc you use, it's impossible to give more exact answer, but your query could look something like
SELECT Col1, Col2, ...
FROM TimeTable tt
WHERE tt.Source = @SourceCity
AND tt.Destination = @DestinationCity
AND tt.DepartureDate = @DepartureDate
All the table names and column names are fictitious so you have to modify this to be suited against your actual database schema.
To run the query you need:
-
SqlConnection[
^]
-
SqlCommand[
^]
-
SqlParameter[
^]
- and most likely
SqlDataAdapter[
^] to fill a datatable for example