C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

i want coding by using SQL Database.


Posted Date: 06 Oct 2008      Posted By: spandhanaspandy      Member Level: Gold     Points: 1   Responses: 2



have a 1 textboxe & 1 dropdownlist, in one textbox if i enter Country Name, the dropdown list should load all the state names of that country should load from the Database. So please anyone give me the coding please





Responses

Author: Tamilselvan    06 Oct 2008Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

hi friend,
You are enter the country value in textbox (here code behind textbox selected index changed event) write a code here

using query like
select * from statename where countryname='"+textbox1.text+"'

and bind the dropdown list box



This may help you.


Regards
Tamilselvan



Author: divya    06 Oct 2008Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

Use the query as
Select state from tablename where countryid=<id>
or
select state from tablename where countryname="countryname"
store the query result in sqldatareader and add it to the dropdownlist .



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Regarding null values in the database
Previous : How to Access the datasource inside item data bound of repeater
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use