473,582 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataBinder.Eval Error!


Subject: DataBinder.Eval Error!

Server Error in '/MSPOS' Application.

------------------------------------------------------------------------
--------

DataBinder.Eval : 'System.Data.Co mmon.DbDataReco rd' does not contain a
property with the name REPORTTO.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: DataBinder.Eval :
'System.Data.Co mmon.DbDataReco rd' does not contain a property with the
name REPORTTO.
Please email me at mc*****@sun.net .bb
I have done the following:
1) Modified my datagrid:
<asp:TemplateCo lumn HeaderText="Rep orts To">
<ItemTemplate >
<%# Convert.ToStrin g(DataBinder.Ev al(Container.Da taItem, "REPORTTO") ) %>
</ItemTemplate>
<FooterTemplate >
<asp:DropdownLi st id="insertRepor tTos" DataSource='<%# BindUserNames()
%>' DataTextField=" REPORTTO" DataValueField= "REPORTTOID " runat="server">
</asp:DropdownLis t>
</FooterTemplate>
<EditItemTempla te>
<asp:DropdownLi st runat="server" id="ddlReportTo s" DataSource='<%#
BindUserNames() %>' DataTextField=" REPORTTO" DataValueField= "REPORTTOID "
selectedindex=' <%#
GetSelectedInde xReportsTo(Data Binder.Eval(Con tainer.DataItem ,
"REPORTTO").ToS tring())%>'>
</asp:DropdownLis t>
</EditItemTemplat e>
</asp:TemplateCol umn>

Now in my datagrid

SELECT USERID,REPORTTO ID,USERNAME,Get UserName(REPORT TOID) AS REPORTTO
FROM TBUSERS

With the above SQL statement. Now I must incorporate it in the
datagrid.
private DataSet BindUserNames()
{
// Populate the ddlDataSet
OdbcConnection myConnection = new
OdbcConnection( "DSN=POS;UID=sy stem;PWD=system ");
myConnection.Op en();
const string strSQLDDL = @"SELECT
USERID,REPORTTO ID,USERNAME,Get UserName(REPORT TOID) AS REPORTTO FROM
TBUSERS";
OdbcDataAdapter myDataAdapter = new OdbcDataAdapter (strSQLDDL,
myConnection);
ddlDataSet3.Cle ar();
myDataAdapter.F ill(ddlDataSet3 , "ddlReportTos") ;
myDataAdapter.D ispose();
myDataAdapter = null;
// In next 2 lines, Dispose removes connection string info, Close is
better.
// Use one or the other, but not both...
// myConnection.Di spose();
myConnection.Cl ose();
return ddlDataSet3;
}
But then I get this error when I run the program:

Server Error in '/MSPOS' Application.
------------------------------------------------------------------------
--------

DataBinder.Eval : 'System.Data.Co mmon.DbDataReco rd' does not contain a
property with the name REPORTTO.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: DataBinder.Eval :
'System.Data.Co mmon.DbDataReco rd' does not contain a property with the
name REPORTTO.

Source Error:
Line 567: <asp:TemplateCo lumn HeaderText="Rep orts To">
Line 568: <ItemTemplate >
Line 569: <asp:Label id="lblReporTo " Runat="server" Text='<%#
Convert.ToStrin g(DataBinder.Ev al(Container.Da taItem,"REPORTT O")) %>'>
Line 570: </asp:Label>
Line 571: </ItemTemplate>
Source File: C:\Inetpub\wwwr oot\MSPOS\Admin istrators.aspx Line: 569

Stack Trace:
[HttpException (0x80004005): DataBinder.Eval :
'System.Data.Co mmon.DbDataReco rd' does not contain a property with the
name REPORTTO.]
System.Web.UI.D ataBinder.GetPr opertyValue(Obj ect container, String
propName) +147
System.Web.UI.D ataBinder.Eval( Object container, String[]
expressionParts ) +71
System.Web.UI.D ataBinder.Eval( Object container, String expression)
+82
ASP.Administrat ors_aspx.__Data Bind__control50 (Object sender,
EventArgs e) in C:\Inetpub\wwwr oot\MSPOS\Admin istrators.aspx: 569
System.Web.UI.C ontrol.OnDataBi nding(EventArgs e) +66
System.Web.UI.C ontrol.DataBind () +26
System.Web.UI.C ontrol.DataBind () +86
System.Web.UI.C ontrol.DataBind () +86
System.Web.UI.W ebControls.Data Grid.CreateItem (Int32 itemIndex, Int32
dataSourceIndex , ListItemType itemType, Boolean dataBind, Object
dataItem, DataGridColumn[] columns, TableRowCollect ion rows,
PagedDataSource pagedDataSource ) +169
System.Web.UI.W ebControls.Data Grid.CreateCont rolHierarchy(Bo olean
useDataSource) +1411
System.Web.UI.W ebControls.Base DataList.OnData Binding(EventAr gs e) +49
System.Web.UI.W ebControls.Base DataList.DataBi nd() +23
ASP.Administrat ors_aspx.BindDa ta() in
C:\Inetpub\wwwr oot\MSPOS\Admin istrators.aspx: 153
ASP.Administrat ors_aspx.Page_L oad(Object sender, EventArgs e) in
C:\Inetpub\wwwr oot\MSPOS\Admin istrators.aspx: 38
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
0 3808

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
724
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash (DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name date) <asp:DataGrid id="RssNewsGrid"
4
2483
by: Søren Lund | last post by:
Hello, I am trying to bind a DataGrid with some data from a DataSet which contains fields in the form "group.fieldname". I am certain that my data source contains the field but I cannot get my head around which syntax to use when specifying which field to bind to the DataGrid. I have tried <%# DataBinder.Eval( Container.DataItem,...
0
1727
by: MS | last post by:
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")...
1
2232
by: Mike Lerch | last post by:
Pretty much, TSIA, but I'll expand a bit: I'm still trying to get my head around the n-tier approach to web design. It seems to me that when you use DataBinder.Eval in the ASPX that your tiers aren't fully separated. If you're displaying data in a DataGrid, is it appropriate to define a label in your template column as <asp:Label...
2
20659
by: jack | last post by:
Hello, I have a date in a SQL Database and want to use the dateformat tools to format the output. I am now using the Month, Day, and Year to do it now. I want to change: Released Date: <%#Month(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" & Day(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" &...
2
11152
by: Oleg Ogurok | last post by:
Hi all, I have a DatePicker ASP.NET control that allows users to enter date (e.g. a calendar control). The control has the following property public DateTime Value { get; set; } I've placed the control into a datagrid now I'm trying to bind values from database to the datagrid.
1
1997
by: Nathan Sokalski | last post by:
I want to make an email link using databinding. I am able to get and display the email address from the database it is stored in using databinding as follows: <asp:HyperLink id="lnkEmail1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.email") %>' Target="_blank"><%# DataBinder.Eval(Container, "DataItem.email")...
2
1284
by: Lam | last post by:
hi I wrote a aspx page in c#. It execute the query to SQL 2000 database and return a DataTable table, bind it to the DataGrid and display on the screen. The page refresh every 10 seconds. it has been running successfully most of the time. but some times it gives me error "DataBinder.Eval: 'System.Data.DataRowView' does not contain a...
4
7338
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever use this quite inelegant OO code wrapped in #<% %> inside the markup? secondly: sometimes you see simliar code inside the markup without calls to
0
7809
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7920
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1413
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.