ASPX Dropdownlist (datasource)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean

    #1

    ASPX Dropdownlist (datasource)

    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
  • David

    #2
    ASPX Dropdownlist (datasource)

    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.DataValueFi eld = "ValueField ";
    ddl.DataTextFie ld = "TextField" ;
    ddl.DataSource = DS.Tables[0].DefaultView;
    ddl.DataBind();

    hope this helps.
    [color=blue]
    >-----Original Message-----
    >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
    >.
    >[/color]

    Comment

    Working...