Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Now I'm doing on line railway reservation project actually i am in trouble. Just tell some idea. My backend is SQL Server.

In asp.net form I give train source and destination in specific date and submit that. It should search the database and should display the matched train details

How can i do this????????
Posted
Updated 6-Sep-11 20:10pm
v2
Comments
Uday P.Singh 7-Sep-11 2:11am    
What you have tried?
nagendrathecoder 7-Sep-11 2:15am    
What is the problem? Have you tried anything? where u got struck?

1 solution

Without knowing the tables etc you use, it's impossible to give more exact answer, but your query could look something like
SQL
SELECT Col1, Col2, ...
FROM TimeTable tt -- or whatever is the table name
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900