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
CodeBehind - OnLoad EventCode:<td>Document type:</td> <td><asp:radiobuttonlist id="DocType" runat="server" ></asp:RadioButtonList></td>
VB Code:
Dim myCmd As New SqlCommand myCmd.CommandType = CommandType.StoredProcedure ' Set command to create your SQL statement myCmd.CommandText = "up_GetPaperTypes" ' Set the database connection myCmd.Connection = myCon myCmd.Parameters.Add("@Jnl_Code", "BJ") Dim dr As SqlDataReader Try dr = myCmd.ExecuteReader() If dr.Read() Then With DocType .DataSource = dr .DataValueField = dr.GetString(0) .DataTextField = dr.GetString(1) .DataBind() End With End If Catch ex As Exception ' Record any exceptions and exit litMsg.Visible = True litMsg.Text = "<p><font color=""red""><b>An exception occurred: GetPaperTypes</b><br />" + ex.Message + "</font></p>" Finally dr.Close() If myCon.State = ConnectionState.Open Then myCon.Close() End Try




Reply With Quote