I found this on the webpage http://www.aspfree.com/c/a/ASP.NET/ASPNE...
Me.DropDownList1.Items.Clear()
Dim da As New SqlDataAdapter("select productID,ProductName from Products", "data source=.;initial catalog=northwind;user id=sa")
Dim ds As New DataSet
da.Fill(ds, "Products")
da.Dispose()
Me.DropDownList1.DataSource = ds.Tables("Products")
Me.DropDownList1.DataTextField = "ProductName"
Me.DropDownList1.DataValueField = "ProductID"
Me.DropDownList1.DataBind()
Hope this helps
Cheers
Peter
|
|
Expert:
|
PeterNZ
|
|
Date:
|
Jul 01, 2007
|
|
Time:
|
23:56
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
thanks. it works.
|
|
Expert:
|
bc030400030
|
|
Date:
|
Jul 05, 2007
|
|
Time:
|
03:42
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|
|
|
|
This question has been answered, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.
|
|