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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdownlist populates w/ System.Data.Common.DbDataRecord 1

Status
Not open for further replies.

bubberz

Programmer
Dec 23, 2004
117
US
I've got a dropdownlist populated via the following:

Con1.Open()
Dim sqlGrp As String
sqlGrp = "SELECT GC+' - '+GD as Expr2, GC, GD, DivC FROM [RLDivG] WHERE DivC= " & "'" & ddlDivision.SelectedValue.ToString() & "'"

Dim myRDR As OleDbDataReader
Dim cmdGrp As New OleDbCommand(sqlGrp, Con1)
ddlGroup2.DataSource = cmdGrp.ExecuteReader(CommandBehavior.CloseConnection)
ddlGroup2.DataBind()
Con1.Close()

I know it's reading the correct records, but the dropdownlist shows "System.Data.Common.DbDataRecord" for each record
 
you need to set the Text and value of the drop down list...

Code:
ddlGroup2.DataValueField = "GC"
ddlGroup2.DataTextField = "GD"

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top