473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to show the data from sql by any chosen value from dropdown menu?

1
I have created a database with name algorithmA4 and with atributes ID(primary key), Row (int), State (varchar).
So, I have to chose any number from dropdown menu (in the Row I have added 50 numbers from 1-15)to show the states in an textarea below that contain that number.
For example: I chose number 5, and after I push the button GO should show in the text area (England, Austria, Germany, France,(states that I have in database with this number))

Please help me!
May 15 '12 #1
2 1652
use this code..
sqlcommand cmd=new sqlcommand("select state from algorithmA4 where ID=5",connection object);
connectionobj.open();
sqldatareader dr=cmd.executereader();
while(Dr.read())
{
textbox1.text+=dr["state"].tostring()+",";
}
textbox1=textbox1.remove(textbox1.length-1,1);
May 31 '12 #2
i think this will help you
May 31 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mosher | last post by:
Hi all, I am looking for some event handler auto-calc help on a form that takes user input through text fields and dropdown menus. I would like some of the text fields to be auto populated when...
0
by: jvb | last post by:
Hello, I have got the following problem. I have an access database with the name of different persons and there telephone numbers. In an access page you can display the field name and the...
2
by: Calvin KD | last post by:
Hi everyone, Can someone show me or point me in the right direction as how to create a "dropdown menu" which displays the menu items as a separete layer over the top of the contents of the page...
3
by: ACaunter | last post by:
Hi there, can someone please tell me what the easiest way to have a dropdown menu bar positioned on the screen (eg. Home, company, ... , contact us) then when the mouse goes over then, the sub...
12
deephill
by: deephill | last post by:
hi i need form dependency. Can u check below code? <p>1. Are you married?</p> <p>
1
akhan
by: akhan | last post by:
i used the following code to enter data in dropdown menu : <? $con=mysql_connect("","",""); mysql_select_db('investment',$con); $query="select *from personal_info"; $res =...
3
by: Ninio | last post by:
I have a simple form with a dropdown menu that consists of 3 option and each option should retrieve a query from a database. i have been looking all over the place and can't seem to find how to do...
1
SHOverine
by: SHOverine | last post by:
Recently my web host decided to "upgrade". This change rendered many of my pages useless and I am scrambling to fix the issues, so you may see several posts from me in the coming days. My first...
3
by: jerrydigital | last post by:
good evening, I am trying to allow my users to enter in text if they don't find their option on my drop down menu. In the code below, I can get a text box to show up when I select 'Other' on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.