Answers
Jul 01, 2007 - 08:56 PM
I found this on the webpage http://www.aspfree.com/c/a/ASP.NET/AS...
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
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
thanks. it works.
Add New Comment