473,396 Members | 1,797 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.

Binding two columns to a DropDownList

Hi all,

I have two columns in a databse that I wish to bind to a dropdownlist, one
column as the value (or index) the other as the text value displayed.

Does anyone know how I can achieve this?

Thank you

Simon
Nov 18 '05 #1
2 2186
Just look at the properties window in the designer, you'll see that this
capability is built in. You can set the DataSource (a dataset, for example)
the DataMember (a datatable) the DataTextField, and the DataValueField.

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi all,

I have two columns in a databse that I wish to bind to a dropdownlist, one
column as the value (or index) the other as the text value displayed.

Does anyone know how I can achieve this?

Thank you

Simon

Nov 18 '05 #2
Just look at the properties window in the designer, you'll see that this
capability is built in. You can set the DataSource (a dataset, for example)
the DataMember (a datatable) the DataTextField, and the DataValueField.

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi all,

I have two columns in a databse that I wish to bind to a dropdownlist, one
column as the value (or index) the other as the text value displayed.

Does anyone know how I can achieve this?

Thank you

Simon

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cw bebop | last post by:
Is there a way to bind two columns from a table to one DropDownList? Below I have the column databound to DropDownList1 and would like to also have the column bound to the same DropDownList1...
2
by: rmorvay | last post by:
I am trying to dynamically build a dropdownlist and bind it to a cell in a grid. I tried to utilize the following code but I am stuck at the point where I bind the dropdownlist to the grid cell. ...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
3
by: Binod Nair | last post by:
Hi All, This is what I am trying to do.I have an aspx page with the the following code block. <asp:DropDownList id="DropDownList1" runat="server" DataSource="<%# GetUsers%>"...
1
by: Moshfegh Hamedani | last post by:
Hi there, I found this question in Amit Kalani's preparation book for exam 70-15 (Developing Web Applications with C#). I think it's a very stupid question! It says the correct answer is A but...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
3
by: mateo | last post by:
Hello, I have a GridView inside which i want to show 3 dropdownList (one for each Column). So i've created 3 TemplateField Continent Country City
6
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
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...
1
by: JJ | last post by:
Hi. I am having trouble getting a dropdownlist to work properly in a detailsview: The code is something like: <asp:DetailsView ID="dvwSubscriber" runat="server" AutoGenerateRows="False" ...
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:
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.