471,330 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

VB.NET databind to drop down list

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.

Jul 21 '05 #1
1 7237
Andy,

You miss the setting of the datatextfield in your dropdownlist
http://msdn.microsoft.com/library/de...fieldtopic.asp

It is now like a datagrid.

I hope this helps,

Cor
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by tal_mcmahon | last post: by
2 posts views Thread by Yoshitha | last post: by
1 post views Thread by Andy | last post: by
5 posts views Thread by Jurgen Appelo | last post: by
4 posts views Thread by TycoonUK | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.