This documentation is archived and is not being maintained.

HtmlSelect.DataMember Property

Gets or sets the set of data to bind to the HtmlSelect control from a DataSource with multiple sets of data.

[Visual Basic]
Public Overridable Property DataMember As String
[C#]
public virtual string DataMember {get; set;}
[C++]
public: __property virtual String* get_DataMember();
public: __property virtual void set_DataMember(String*);
[JScript]
public function get DataMember() : String;
public function set DataMember(String);

Property Value

The set of data to bind to the HtmlSelect control from a DataSource with multiple sets of data.

Remarks

If the DataSource contains multiple sets of data, use the DataMember property to specify which set of data to bind to the control. For example, if you have a System.Data.DataSet with multiple tables, use this property to indicate which table to bind to the control.

Once you've specified the data source to bind to the control, you can then specify which fields from the data source to bind to the ListItem.Text and ListItem.Value properties of each item in the control by setting the DataTextField and DataValueField properties, respectively.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

HtmlSelect Class | HtmlSelect Members | System.Web.UI.HtmlControls Namespace | DataSource | DataTextField | DataValueField | ListItem.Text | ListItem.Value

Show: