473,729 Members | 2,353 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 2310
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
48229
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, EncoderParameters encoderParams)
6
2858
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 compile. Can someone please help with this issue? Thank in advance, Tom
1
1858
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
1398
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 current web request. Please review the stack trace for more information about the error and where it...
7
11929
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
4518
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 statement have a field named
5
3636
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") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
2
1707
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 caused was regarding the fact that I pass the header to a standard error handling class to process the...
1
4161
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 PROJECTS\DLLEXERCISE\DEBUG_BUILD\MANI.OBJ Error: Unresolved external 'ImqObj::~ImqObj()' referenced from C:\DOCUMENTS AND...
0
8761
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3238
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
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.