S
Steven K
Hello,
I am using the following to bind data from a stored procedure to a
DropDownList. The problem I am having is that instead of getting the data,
I am getting the text "System.Data.Common.DbDataRecord" for every record,
even though if I use a loop, I get the correct information.
Dim spBusUnit As OleDb.OleDbDataReader
Dim prmBusUnit As OleDbParameter
Dim cmdBusUnit As New OleDb.OleDbCommand("sp_Search", cnnSearch)
Data Binding
-------------
spBusUnit = cmdBusUnit.ExecuteReader()
cboBusUnitBox.DataSource = spBusUnit
cboBusUnitBox.DataBind()
spBusUnit.Close() : spBusUnit = Nothing
Looping through data
----------------------
spBusUnit = cmdBusUnit.ExecuteReader()
Do While spBusUnit.Read
strListBox = spBusUnit("BusinessProduct_ID")
strBusUnitBox = strBusUnitBox & "<option value=" & strQuote & strListBox &
strQuote & ">" & strListBox & "</option>"
Loop
spBusUnit.Close() : spBusUnit = Nothing
I am using the following to bind data from a stored procedure to a
DropDownList. The problem I am having is that instead of getting the data,
I am getting the text "System.Data.Common.DbDataRecord" for every record,
even though if I use a loop, I get the correct information.
Dim spBusUnit As OleDb.OleDbDataReader
Dim prmBusUnit As OleDbParameter
Dim cmdBusUnit As New OleDb.OleDbCommand("sp_Search", cnnSearch)
Data Binding
-------------
spBusUnit = cmdBusUnit.ExecuteReader()
cboBusUnitBox.DataSource = spBusUnit
cboBusUnitBox.DataBind()
spBusUnit.Close() : spBusUnit = Nothing
Looping through data
----------------------
spBusUnit = cmdBusUnit.ExecuteReader()
Do While spBusUnit.Read
strListBox = spBusUnit("BusinessProduct_ID")
strBusUnitBox = strBusUnitBox & "<option value=" & strQuote & strListBox &
strQuote & ">" & strListBox & "</option>"
Loop
spBusUnit.Close() : spBusUnit = Nothing