all groups > dotnet general > august 2003 >
You're in the

dotnet general

group:

ASPX Dropdownlist (datasource)


ASPX Dropdownlist (datasource) Sean
8/7/2003 8:43:46 PM
dotnet general:
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,
ASPX Dropdownlist (datasource) David
8/8/2003 7:30:15 AM
Heres one way of doing it in c#

for simplicity my drop down list is called ddl and my data
source is a dataset called DS

ddl.DataValueField = "ValueField";
ddl.DataTextField = "TextField";
ddl.DataSource = DS.Tables[0].DefaultView;
ddl.DataBind();

hope this helps.

[quoted text, click to view]
AddThis Social Bookmark Button