Hi,

I'm trying to bind a radiobuttonlist to a db table but am getting the following error

DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Full Paper

Full Paper is one of the text values from my dataReader??

Here is my HTML
Code:
<td>Document type:</td>
<td><asp:radiobuttonlist id="DocType" runat="server" ></asp:RadioButtonList></td>
CodeBehind - OnLoad Event
VB Code:
  1. Dim myCmd As New SqlCommand
  2. myCmd.CommandType = CommandType.StoredProcedure
  3. ' Set command to create your SQL statement
  4. myCmd.CommandText = "up_GetPaperTypes"
  5. ' Set the database connection
  6. myCmd.Connection = myCon
  7. myCmd.Parameters.Add("@Jnl_Code", "BJ")
  8.  
  9. Dim dr As SqlDataReader
  10.  
  11. Try
  12.     dr = myCmd.ExecuteReader()
  13.     If dr.Read() Then
  14.     With DocType
  15.         .DataSource = dr
  16.         .DataValueField = dr.GetString(0)
  17.         .DataTextField = dr.GetString(1)
  18.         .DataBind()
  19.     End With
  20.     End If
  21. Catch ex As Exception
  22.     ' Record any exceptions and exit
  23.     litMsg.Visible = True
  24.     litMsg.Text = "<p><font color=""red""><b>An exception occurred: GetPaperTypes</b><br />" + ex.Message + "</font></p>"
  25. Finally
  26.     dr.Close()
  27.     If myCon.State = ConnectionState.Open Then myCon.Close()
  28. End Try