Click here to Skip to main content
15,910,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one dropdown list and one textbox.
I have one table branch.
I select database in dropdownlist by configuring database.so branch no come in drop down list.
I select the text in dropdown list and i have to show only branch name of selected branch no in text box.
then how to show?
plz help me.
Posted
Comments
[no name] 23-Jan-13 7:34am    
What I understood is:
1.you have branch numbers in dropdownlist as numbers,right?
2.Populate the branch name of the associated branch[num] from dropdonwlist,right?
amu jamdade 23-Jan-13 7:37am    
yes..
it is right

Amu ,

I want you to do it yourself . Below is algorithm . Read it step by step . Do the thing and will result into what you want.
I hope you are using some other language also for framework(VB.net Or C# ETC)

Note : Please replace framework language "{Your FW Lang}" in below steps with language you are using for FW.

Algorithm
1) Create one public method in your language to connect the database (Connection object)
2) Open "WWW.GOOGLE.COM" and search for "How to connect database in "{Your FW Lang}"
3) Modified connection string in the code you have found in above step so that it will take database name from use selection
4) Call this method on click event of "Database Selection Drop Down Box"
5) It will create connection object which will have database connection
6) Create one method to populate branch no taking source as database table. Use connection object created in above step
7) Call this method along with step no 4
8) Create one more method with will run query to find branch name from branch no. Use connection object created in step#3
9) Call this method on click event of "Branch No Selection Drop Down Box" and display result on to text box

Hope this will help if yes then vote and accept the answer otherwise revert back with your queries
--RD
 
Share this answer
 
I assume you previously loaded data into dropdownlist soo next step is selected data to be shown in textbox, that step is:

1.
double click on your dropdown control and writte the following code:

2.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.TextBox1.Text = this.DropDownList1.SelectedItem.Text;
}

I hope this will help you...
 
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