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.
Cor Ligthert - 26 Apr 2005 16:00 GMT
Andy,
You miss the setting of the datatextfield in your dropdownlist
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwebuiwebcontrolslistcontrolclassdatatextfieldtopic.asp
It is now like a datagrid.
I hope this helps,
Cor