Problem with datagrid DataBinder.Eval: 'System.Data.DataRowView' does ....

M

MS

I am very new to asp.net. Please help me in resolving the error:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property
with the name RENEW_EXIST.
I get the above error with the following code in aspx page
<asp:Label ID="lblRenewExist" Visible="False" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "RENEW_EXIST") %>' />

If I change DataBinder.Eval(Container.DataItem, "RENEW_EXIST") to
Container(DataItem."RENEW_EXIST"), the error message is changed to
BC30367: Class 'System.Web.UI.WebControls.DataGridItem' cannot be
indexed because it has no default property.
PLEASE HELP!!!

Dim oDA = New System.Data.SqlClient.SqlDataAdapter()
Dim oConn = New System.Data.SqlClient.SqlConnection()
Dim oCmd = New System.Data.SqlClient.SqlCommand()
Dim oDs = New DataSet()
oConn = Application("ConnString")
oDA.SelectCommand = oCmd
oDA.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "SPAR_REL", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("REL_ID", "REL_ID"), New
System.Data.Common.DataColumnMapping("REL_NAME", "REL_NAME"), New
System.Data.Common.DataColumnMapping("TM_OFFICER", "TM_OFFICER"), New
System.Data.Common.DataColumnMapping("NUM_ACCTS", "NUM_ACCTS"), New
System.Data.Common.DataColumnMapping........("RENEW_RATE",
"RENEW_RATE"), New System.Data.Common.DataColumnMapping("RENEW_LIMIT",
"RENEW_LIMIT"), New System.Data.Common.DataColumnMapping("RENEW_NOTICE",
"RENEW_NOTICE"), New
System.Data.Common.DataColumnMapping("RENEW_EXIST", "RENEW_EXIST")})})

'SqlSelectCommand1 '
oCmd.CommandText = "[sp_SPAR_SelectCmdRel]"
oCmd.CommandType = System.Data.CommandType.StoredProcedure
oCmd.Connection = oConn
oCmd.Parameters("@CSM_ID").Value = Session("User_ID")
oDA.Fill(oDs, "SPAR_REL")
DataGrid1.DataSource = oDs
DataGrid1.DataBind()
oDA.Dispose()
oDA = Nothing
oDs.Dispose()
oDs = Nothing
oConn.Close()
oConn = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top