Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox showing "System.Data.DataRowView" for all values 1

Status
Not open for further replies.

kermitforney

Technical User
Mar 15, 2005
374
US
Let me preface this post by explaining that I am VERY new to .Net and usually have my head stuck up SQL Server Management Studio.

I am trying to modify a combobox so that it displays the values returned from a stored procedure. Seems pretty simple, but when Debugging, the only values that are displayed are the "System.Data.DataRowView" for every value returned.

Somehow I am not assigning the value correctly, just not sure how.

Code:
cmd.CommandText = "stpRecruiters"
                cmd.Parameters.Clear()
                dtr = cmd.ExecuteReader()
                dtb.Clear()
                dtb.Columns.Add(New DataColumn("strAssignedRecruiter", GetType(String)))

                While dtr.Read
                    drw = dtb.NewRow
                    drw("strAssignedRecruiter") = dtr("strAssignedRecruiter")
                    dtb.Rows.Add(drw)
                End While

                cboRecruiter.DataSource = dtb
                cboRecruiter.DataBind()
                dtr.Close()
 
Set the DisplayMember and ValueMember of your ComboBox.
 
I should have specified that this project was in the .Net 1.1 framework.

DisplayMember and ValueMember are not members of the ListControl Class in .Net 1.1.

Thanks though, River!

Any other solutions?
 
ListControl? What is that? Is than a WebForms control? Most webforms questions go in the ASP.Net forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top