VB.NET databind to drop down list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a stored procedure in SQL Server that returns a list of names that I
would like to bind to a drop down list. This is the code I have, but it is
not working correctly. The drop down contains System.Data.DataRowView


Dim ConString As String = ConfigurationSettings.AppSettings("cs")
Dim myCon As New SqlConnection(ConString)

Dim CmdTextAssignedToListing As String = "usp_GetAssignedToNames"
Dim CmdAssignedToListing As New
SqlDataAdapter(CmdTextAssignedToListing, myCon)

Dim dsAssignedToListing As New DataSet
'fill drop down with user names
CmdAssignedToListing.Fill(dsAssignedToListing)

'Databind to the Drop Down
DropDownAssignedTo.DataSource = dsAssignedToListing
DropDownAssignedTo.DataBind()

Any help is appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top