473,574 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexplained error when databinding

I am using a DataSet as the DataSource of a DataList in my code. The SQL
used to get the data from the database begins with:
SELECT
members.organiz ation,artists.a rtist,artists.e mail,artists.we bsite,members.e mail
FROM members INNER JOIN artists ON members.memberi d=artists.membe rid WHERE
Notice that both tables involved in the SELECT statement have a field named
email. First, I do not know how to specify which one I want in my
databinding expressions (I tried DataItem.artist s.email and
DataItem.member s.email, but that gave me an error too). Second, I know that
my DataSet is getting filled correctly because my first databinding
expression worked (see line 71 in the error). My error is as follows:
Server Error in '/' Application.
--------------------------------------------------------------------------------

DataBinder.Eval : 'System.Data.Da taRowView' does not contain a property with
the name email.
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.Da taRowView' does not contain a property with the name email.

Source Error:

Line 70: <ItemTemplate >
Line 71: <asp:Label id=lblOrganizat ion1 runat="server" Width="175px"
text='<%# DataBinder.Eval (Container, "DataItem.organ ization")
%>'></asp:Label>
Line 72: <asp:HyperLin k id="lnkPresente rEmail1" runat="server"
Width="175px" text='<%# DataBinder.Eval (Container, "DataItem.email ") %>'
NavigateUrl='<% # DataBinder.Eval (Container, "DataItem.email ","MAILTO:{ 0}")
%>' Target="_blank" ></asp:HyperLink>
Line 73: <asp:Label id=lblArtist1 runat="server" Width="125" text='<%#
DataBinder.Eval (Container, "DataItem.artis t") %>'></asp:Label>
Line 74: <asp:HyperLin k id=lnkEmail1 runat="server" Width="175"
text='<%# DataBinder.Eval (Container, "DataItem.email ") %>' NavigateUrl='<% #
DataBinder.Eval (Container, "DataItem.email ","MAILTO:{ 0}") %>'
Target="_blank" ></asp:HyperLink>

Source File: D:\Clients\1265 4\papresenters. org\papresenter s.org\search.as px
Line: 72

Stack Trace:

[HttpException (0x80004005): DataBinder.Eval : 'System.Data.Da taRowView' does
not contain a property with the name email.]
System.Web.UI.D ataBinder.GetPr opertyValue(Obj ect container, String
propName) +146
System.Web.UI.D ataBinder.Eval( Object container, String[] expressionParts )
+71
System.Web.UI.D ataBinder.Eval( Object container, String expression) +82
ASP.search_aspx .__DataBind__co ntrol34(Object sender, EventArgs e) in
D:\Clients\1265 4\papresenters. org\papresenter s.org\search.as px:72
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.W ebControls.Data List.CreateItem (Int32 itemIndex,
ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.W ebControls.Data List.CreateCont rolHierarchy(Bo olean
useDataSource) +683
System.Web.UI.W ebControls.Base DataList.OnData Binding(EventAr gs e) +48
System.Web.UI.W ebControls.Base DataList.DataBi nd() +23
PAPresenters.se arch.btnSearch_ Click(Object sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.432 2.2300

Can anyone help me with this? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
6 2305
ng
The reason you aren't finding 'email' is because SQL databases assign an
arbitrary column name if you have two matching names, or they leave the
qualifier in the name, such as artists.email and members.email. Try
assigning new names to the columns in your SQL statement, like "select
members.email m_email, artists.email a_email" and then use the new
column names in your binding.

Tom
Nathan Sokalski wrote:
I am using a DataSet as the DataSource of a DataList in my code. The SQL
used to get the data from the database begins with:
SELECT
members.organi zation,artists. artist,artists. email,artists.w ebsite,members. email
FROM members INNER JOIN artists ON members.memberi d=artists.membe rid WHERE
Notice that both tables involved in the SELECT statement have a field named
email. First, I do not know how to specify which one I want in my
databinding expressions (I tried DataItem.artist s.email and
DataItem.membe rs.email, but that gave me an error too). Second, I know that
my DataSet is getting filled correctly because my first databinding
expression worked (see line 71 in the error). My error is as follows:
Server Error in '/' Application.
--------------------------------------------------------------------------------

DataBinder.Eva l: 'System.Data.Da taRowView' does not contain a property with
the name email.
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.D ataRowView' does not contain a property with the name email.

Source Error:

Line 70: <ItemTemplate >
Line 71: <asp:Label id=lblOrganizat ion1 runat="server" Width="175px"
text='<%# DataBinder.Eval (Container, "DataItem.organ ization")
%>'></asp:Label>
Line 72: <asp:HyperLin k id="lnkPresente rEmail1" runat="server"
Width="175px " text='<%# DataBinder.Eval (Container, "DataItem.email ") %>'
NavigateUrl='< %# DataBinder.Eval (Container, "DataItem.email ","MAILTO:{ 0}")
%>' Target="_blank" ></asp:HyperLink>
Line 73: <asp:Label id=lblArtist1 runat="server" Width="125" text='<%#
DataBinder.Eva l(Container, "DataItem.artis t") %>'></asp:Label>
Line 74: <asp:HyperLin k id=lnkEmail1 runat="server" Width="175"
text='<%# DataBinder.Eval (Container, "DataItem.email ") %>' NavigateUrl='<% #
DataBinder.Eva l(Container, "DataItem.email ","MAILTO:{ 0}") %>'
Target="_blank "></asp:HyperLink>

Source File: D:\Clients\1265 4\papresenters. org\papresenter s.org\search.as px
Line: 72

Stack Trace:

[HttpException (0x80004005): DataBinder.Eval : 'System.Data.Da taRowView' does
not contain a property with the name email.]
System.Web.UI.D ataBinder.GetPr opertyValue(Obj ect container, String
propName) +146
System.Web.UI.D ataBinder.Eval( Object container, String[] expressionParts )
+71
System.Web.UI.D ataBinder.Eval( Object container, String expression) +82
ASP.search_aspx .__DataBind__co ntrol34(Object sender, EventArgs e) in
D:\Clients\126 54\papresenters .org\papresente rs.org\search.a spx:72
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.W ebControls.Data List.CreateItem (Int32 itemIndex,
ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.W ebControls.Data List.CreateCont rolHierarchy(Bo olean
useDataSourc e) +683
System.Web.UI.W ebControls.Base DataList.OnData Binding(EventAr gs e) +48
System.Web.UI.W ebControls.Base DataList.DataBi nd() +23
PAPresenters.se arch.btnSearch_ Click(Object sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgumen t) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceContro l, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.43 22.2300

Can anyone help me with this? Thanks.

Nov 19 '05 #2
Bob
Nathan:

Or you could just rename the fields in the database to MEmail and AEmail

Bob
Nov 19 '05 #3
Bob
Nathan:

Or you could rename the fields in the database tables to MEmail and AEmail.

Dont forget to clean up the garbage code left behind in the "Windows Form
Designer Generated Code.

Seems to be a problem with VS not doing it when you regenerate the DA's

Today I cleaned up some 2000 lines of code in there. Big diff in
performance.

Bob

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:O7******** *****@TK2MSFTNG P10.phx.gbl...
I am using a DataSet as the DataSource of a DataList in my code. The SQL
used to get the data from the database begins with:
SELECT
members.organiz ation,artists.a rtist,artists.e mail,artists.we bsite,members.e mail
FROM members INNER JOIN artists ON members.memberi d=artists.membe rid WHERE
Notice that both tables involved in the SELECT statement have a field
named email. First, I do not know how to specify which one I want in my
databinding expressions (I tried DataItem.artist s.email and
DataItem.member s.email, but that gave me an error too). Second, I know
that my DataSet is getting filled correctly because my first databinding
expression worked (see line 71 in the error). My error is as follows:
Server Error in '/' Application.
--------------------------------------------------------------------------------

DataBinder.Eval : 'System.Data.Da taRowView' does not contain a property
with the name email.
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.Da taRowView' does not contain a property with the name email.

Source Error:

Line 70: <ItemTemplate >
Line 71: <asp:Label id=lblOrganizat ion1 runat="server" Width="175px"
text='<%# DataBinder.Eval (Container, "DataItem.organ ization")
%>'></asp:Label>
Line 72: <asp:HyperLin k id="lnkPresente rEmail1" runat="server"
Width="175px" text='<%# DataBinder.Eval (Container, "DataItem.email ") %>'
NavigateUrl='<% # DataBinder.Eval (Container, "DataItem.email ","MAILTO:{ 0}")
%>' Target="_blank" ></asp:HyperLink>
Line 73: <asp:Label id=lblArtist1 runat="server" Width="125" text='<%#
DataBinder.Eval (Container, "DataItem.artis t") %>'></asp:Label>
Line 74: <asp:HyperLin k id=lnkEmail1 runat="server" Width="175" text='<%#
DataBinder.Eval (Container, "DataItem.email ") %>' NavigateUrl='<% #
DataBinder.Eval (Container, "DataItem.email ","MAILTO:{ 0}") %>'
Target="_blank" ></asp:HyperLink>

Source File:
D:\Clients\1265 4\papresenters. org\papresenter s.org\search.as px Line: 72

Stack Trace:

[HttpException (0x80004005): DataBinder.Eval : 'System.Data.Da taRowView'
does not contain a property with the name email.]
System.Web.UI.D ataBinder.GetPr opertyValue(Obj ect container, String
propName) +146
System.Web.UI.D ataBinder.Eval( Object container, String[]
expressionParts ) +71
System.Web.UI.D ataBinder.Eval( Object container, String expression) +82
ASP.search_aspx .__DataBind__co ntrol34(Object sender, EventArgs e) in
D:\Clients\1265 4\papresenters. org\papresenter s.org\search.as px:72
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.W ebControls.Data List.CreateItem (Int32 itemIndex,
ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.W ebControls.Data List.CreateCont rolHierarchy(Bo olean
useDataSource) +683
System.Web.UI.W ebControls.Base DataList.OnData Binding(EventAr gs e) +48
System.Web.UI.W ebControls.Base DataList.DataBi nd() +23
PAPresenters.se arch.btnSearch_ Click(Object sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300;
ASP.NET Version:1.1.432 2.2300

Can anyone help me with this? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #4
>
Or you could just rename the fields in the database to MEmail and AEmail

That is something I never would do. The method of ng is in my opinion the
right one.

Just my thought,

Cor
Nov 19 '05 #5
Bob
Cor:

Why not? Wouldn't it make things a little easyer to inerpret and provide
for less aliases?

Bob
Nov 19 '05 #6
Nathan:

Change this:

SELECT
members.organiz ation,artists.a rtist,artists.e mail,artists.we bsite,member
s.email
FROM members INNER JOIN artists ON members.memberi d=artists.membe rid

to this:

SELECT m.organization, a.artist, a.email As AEmail,
a.website, m.email As MEmail
FROM members m
INNER JOIN artists a
ON m.memberid = a.memberid

This is called aliasing the tables and the columns that have the same
name (notice that I put an "m" after members and an "a" after artists;
these are the aliases for the tables). Your datatable (in the dataset)
will use the aliased named (Aemail and Memail). This way you can leave
your database as is.

John

Nov 19 '05 #7

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

Similar topics

4
48198
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+. System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder,...
6
2840
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked fine while the file was in the project directory. When the obsolete file was removed from the project directory, my application will no longer...
1
1851
by: Matt | last post by:
When I try to run the ASP.NET application, it has the following error messages: Error while trying to run project: unable to start debugging on the web server. The project is not configured to be debugged
1
1389
by: Nathan Sokalski | last post by:
When I run my application, which uses databinding in a DataList, I recieve the following error: Server Error in '/' Application. -------------------------------------------------------------------------------- Public member 'title' on type 'DataRowView' not found. Description: An unhandled exception occurred during the execution of the...
7
11910
by: BS | last post by:
Hello everybody I'm calling a webservice that returns complex data. The goal is to populate a datagrid with it. Using a loop for each record found ( such as For i = 0 To oResponse.historicalData.Length - 1 ) no problem to load a datagrid. However, when I try to bind directly the datasource to the web service
5
4513
by: Nathan Sokalski | last post by:
I am using a DataSet as the DataSource of a DataList in my code. The SQL used to get the data from the database begins with: SELECT members.organization,artists.artist,artists.email,artists.website,members.email FROM members INNER JOIN artists ON members.memberid=artists.memberid WHERE Notice that both tables involved in the SELECT...
5
3615
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")...
2
1700
by: DCC700 | last post by:
VS 2005 Converted Header causing error when publishing After converting from Visual Studio 2003 to 2005, I have had several issues with a header that is used throughout the project. The conversion automatically created an abstract base class for the header in the Migrated folder of the App_Code directory. One of the major problems this...
1
4150
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- Error: Unresolved external 'ImqMgr::~ImqMgr()' referenced from C:\DOCUMENTS AND SETTINGS\228753\MY DOCUMENTS\BORLAND STUDIO...
0
7738
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
8078
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
7829
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
6477
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
5634
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
5319
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
3755
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
2254
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
1359
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.