Answers
Jul 01, 2007 - 08:56 PM
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
Jul 05, 2007 - 12:42 AM
Add New Comment