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
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