Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my project I need to compare user selected data with database in sql server 2005.

for example
source:mumbai
destination:chennai

The two dropdownlistselecteditem should compare to database if match. What are rows match it will display in anthor form

How can this be done?

Thanks.
Posted
Updated 23-Sep-11 0:42am
v4
Comments
Pravin Patil, Mumbai 23-Sep-11 6:27am    
What is the problem that you are facing.?
Thiagarajan Duraisamy 23-Sep-11 6:31am    
what is your problem here. Do u want the solution or a solution for your error.
Rajesh Anuhya 23-Sep-11 6:36am    
R U done anything??, do/start something....

1 solution

SQL
SQL
SELECT * FROM Location WHERE Source = 'Mumbai' AND Destination = 'Chennai'

C#.Net
C#
string SQL = "SELECT * FROM Location WHERE Source = '"+ ddlSource.SelectedValue +"' AND Destination = '"+ ddlDestination.SelectedValue +"'
 
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