Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using 2 dropdown ,when i choose the country in 1st dropdown i need to bind the corresponding cities in 2nd dropdown. but in stored procedure .How can i do .

Help me.
Posted

1 solution

 
Share this answer
 
Comments
priya from Madras 24-Jan-12 9:56am    
ya but i need this in stored procedure
Bryian Tan 24-Jan-12 10:33am    
based on the example from c-sharpcorner.com. Modify the following line

SqlCommand cmd = new SqlCommand("select County,CountryId from Country", conn);
SqlDataReader dr = cmd.ExecuteReader();

TO

SqlCommand cmd = new SqlCommand("GetCountry", conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
SqlDataReader dr = cmd.ExecuteReader();

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