473,396 Members | 1,864 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,396 software developers and data experts.

How to Get one whole column's value into dropdownlist?

hai,
I'm working with Web applications..
I want to obtain all the values of a column from a table into a dropdownlist..
help me out plz.....
Mar 21 '07 #1
6 1273
dip_developer
648 Expert 512MB
hai,
I'm working with Web applications..
I want to obtain all the values of a column from a table into a dropdownlist..
help me out plz.....
bring your record from table into a Dataset, say DataSet1

then set your combobox property as this
ComboBox1.Datasource=Dataset1.Tables(0)
ComboBox1.DisplayMember="TableFieldName"
Mar 21 '07 #2
hai,
Thanks....
But, wat is the use of these two lines????????

ddlOrgType.DataValueField ="BM_Id";
ddlOrgType.DataTextField ="BM_Desc";
Mar 21 '07 #3
sani723
117 100+
ddlstu.DataTextField = "name"
ddlstu.DataValueField = "roll"

suppose you have 2 columns in ur table one is student name and other is student roll number, so it will bind the name field as a text means name will be visible in dropdownlist and value field be roll number. but if u don't want to use the valuefield (2nd one) then first will work fine
Mar 21 '07 #4
thank u very much......
i am very new to java script..
i want to make a self study for that..
help me out to find some links r materials regarding the basics of java script..
Mar 21 '07 #5
sani723
117 100+
this one is really godd for u. http://www.w3schools.com/js/js_intro.asp
Mar 21 '07 #6
dip_developer
648 Expert 512MB
hai,
I'm working with Web applications..
I want to obtain all the values of a column from a table into a dropdownlist..
help me out plz.....
Sorry Nithya.....

I have totally overlooked the word "Web application"...
it is DataValueField and DataTextField for sure.....
Mar 21 '07 #7

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

Similar topics

0
by: Stephan Bour | last post by:
I need to implement a simple search function to lookup order information in a SQLserver table. The code below works fine for a search to the łOrderID˛ column. However, Iąd like to offer the user...
1
by: Harold | last post by:
Hi all, having a little difficulty binding up a dropdownlist control in a datagrid column. I know I must be missing something Here are 2 methods. One is the DataGrid's ItemDataBound event to catch...
3
by: mg | last post by:
I have a DataGrid (WebForm - C#) that has a template column that contains a dropdownlist named "DdlTest" In DataGrid1_UpdateCommand, the lin DropDownList ddlTest = (DropDownList)...
2
by: Ron | last post by:
Hello, I am trying to create a page that pulls class rosters from an SQLServer database. The roster table definition is: emp_id(pk, fk), sec_id(pk, fk), reg_date and reg_status. Status can be...
2
by: Billy | last post by:
Change DataGrid EditControl On Data Value Hi, I have a datagrid, and on editing, I want to change the control in the third colunm based on the value of the first column. The value in the...
2
by: KerryL | last post by:
How do I update the value of a databound column within my datagrid from within the SelectedIndexChanged event of a dropdownlist, also found within my datagrid? I believe I need to determine the...
0
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from...
2
by: =?Utf-8?B?RGFuaWVs?= | last post by:
Hello everyone can you please help me in finding out how i can bind a column to a dropdownlist at run time. I'm using vb.net with sql server 2000. Its for a web development i tried this but...
0
by: Slickuser | last post by:
Is there a way to get values from GridView when it's a hidden Column. This code work if my column is set Visible to true. DropDownList ddl = (DropDownList)sender; GridViewRow row =...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.