Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2011, 06:31 PM
Registered User
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a p

Hi,

I am using a ListView to display info from the DB. I wanted to use the emailaddress that is being binded into the Email label control through the Eval keyword.

Code:
 protected void ViewAllProperty_ItemCreated(object sender, ListViewItemEventArgs e)
    {
       // Label EmailTB;
        if (e.Item.ItemType == ListViewItemType.DataItem)
        {
           // EmailTB = (Label)e.Item.FindControl("EmailTB");


            ListViewDataItem dataItem = (ListViewDataItem) e.Item;

            string currentEmailAddress = (string) DataBinder.Eval(dataItem.DataItem, "EmailTB");

            DataRowView rowView = (DataRowView)dataItem.DataItem;
                                   
            string Username = Membership.GetUserNameByEmail(currentEmailAddress);

            lbUsername.Text = Username;
        }

    }
With this I am getting this error:

System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'EmailTB'.

thx
 
Old December 5th, 2011, 04:40 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

The message clearly states that there is no columns returned from the database called "EmailTB". Can you check your SQL Query or Class whether it contains a field with the above name.

Regards
__________________
Regards
Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.web.httpException Error Gayathri79 ASP.NET 3.5 Basics 1 April 28th, 2010 05:27 PM
Linq: DataBinding: 'System.Char' does not contain a property with the name 'X'. cortttt BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 August 21st, 2009 03:42 AM
System.Web.HttpException: Request timed out Ron Howerton General .NET 0 May 21st, 2008 08:23 AM
System.Web.HttpException: Invalid mail attachment kapi.goel C# 4 September 6th, 2007 02:48 AM
'System.Data.DataRowView' does not contain a prope kenn_rosie VS.NET 2002/2003 0 May 1st, 2006 09:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.