Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 23-Jan-13 2:29am
Comments
shabari7 at 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 at 23-Jan-13 7:37am
   
yes..
it is right
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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...
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 476
1 Sergey Alexandrovich Kryukov 235
2 CHill60 195
3 Afzaal Ahmad Zeeshan 145
4 TheRealSteveJudge 120
0 Sergey Alexandrovich Kryukov 9,121
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100