Binding dataset to a ListBox.

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

In ASP.Net C# windows form, how do I bind a DataSet to a ListBox so the
ListBox will display data?
Thanks for help.

Jason
 
In ASP.Net C# windows form

ASP.NET uses WebForms, not WinForms.

Are you talking about binding a datasource to an <asp:ListBox /> WebControl
on an ASPX page?

Please clarify...
 
listBoxName.DataSource = DataSet.Tables[TableIndex];
listBoxName.DataTextField = "FieldName";
listBoxName.DataValueField = "FieldName";
listBoxName.DataBind();
 
Back
Top