By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

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

P: n/a
I am very new to 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.

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
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........("RENE W_RATE",
"RENEW_RATE"), New System.Data.Common.DataColumnMapping("RENEW_LIMIT" ,
"RENEW_LIMIT"), New System.Data.Common.DataColumnMapping("RENEW_NOTICE ",
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
oDA = Nothing
oDs = Nothing
oConn = Nothing
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.