473,395 Members | 1,919 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.

ASPX Dropdownlist

Hi,

I have an ASPX Dropdown list.

I am unsure how to set my datasource.

I have a table that has 2 columns, an identity column and
a description column.

Has anyone got some sample code on how to do this.

I find it hard to get any sample code on the web.

Thanks,
Sean
Nov 17 '05 #1
1 1274
hi Sean,

look at http://samples.gotdotnet.com/quickstart/aspplus/ for a lot of
samples..

for your ddl problem:

DropDownList ddl = new DropDownList();
ddl.DataSource = yourDataTable; /// can also be a DataSet
ddl.DataTextField = "NameOfFieldWhichContainsText";
ddl.DataValueField ="NameOfFieldWhichContainsValue";
ddl.DataBind(); /// get the values from the DataSource

that should do the trick
regards
karten

"Sean" <se**@asp.com> schrieb im Newsbeitrag
news:05****************************@phx.gbl...
Hi,

I have an ASPX Dropdown list.

I am unsure how to set my datasource.

I have a table that has 2 columns, an identity column and
a description column.

Has anyone got some sample code on how to do this.

I find it hard to get any sample code on the web.

Thanks,
Sean

Nov 17 '05 #2

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

Similar topics

0
by: Kerri | last post by:
Hi, I have an asp dropdownlist. Depending on what the user selects I want to make another text box visible. Is there no ONCLICK event for an asp dropdownlist so I can check what the user...
4
by: Keith | last post by:
I have this simple scenario. -------- Choose an item ->dropdownlist-> or <a>Create a new item</a> -------- When someone decides to click on the create a new item link, it takes them to a...
1
by: rom | last post by:
Hi, I have an aspx page with header as user control, footer as user control, and 2 other user controls inside the page. I'm trying to access a seleted value of a dropdownlist the exists in...
3
by: Shapper | last post by:
Hello, How to I create add Div with an Asp:Label and an Asp:DropDownList inside it to my aspx page from my vb.net code? Thanks, Miguel
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
4
by: Anna S | last post by:
Hi all, I have an aspx page that opens with some parameter (mypage.aspx?idclient=1). Next, I have a dropdown list on this page that lets select the new value of parameter idclient. Than I just...
8
by: gnewsgroup | last post by:
I know that we can re-use/share code by placing the code in App_Code. But, is it possible for MyPage.aspx.cs to call a method defined in AnotherPage.aspx.cs? Suppose, in AnotherPage.aspx.cs,...
3
by: gnewsgroup | last post by:
This might have been discussed before, but I haven't been able to dig it out. I ask because I notice something interesting. Suppose, I have the following controls in a web form. ...
4
by: =?Utf-8?B?SmFwZQ==?= | last post by:
Can I refer to the controls on default.aspx from the masterpage? I have a form on the masterpage which sends information that is in a gridview in the default.aspx page.
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.