467,921 Members | 1,421 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,921 developers. It's quick & easy.

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

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........("RENE W_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
Nov 18 '05 #1
  • viewed: 1528
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bennett Haselton | last post: by
3 posts views Thread by CVerma | last post: by
2 posts views Thread by wolfgang wagner | last post: by
reply views Thread by rkbnair | last post: by
2 posts views Thread by zambizzi | last post: by
7 posts views Thread by Girish | last post: by
4 posts views Thread by CharlesA | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.