Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 December 2nd, 2005, 04:48 AM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with fieldname dot notation

Hello,

I'm trying to pass a parameter with the value of a datafield whose name contains a dot and in datagrid in VS Designer doesn't read it. The code I'm trying to run is the following:

<Columns>
        <asp:TemplateColumn>
        <ItemTemplate>
        <asp:Label><a href="wmpho-details.aspx?id=<%# DataBinder.Eval(Container.DataItem, "Identifier.systemid") %>&title=<%# DataBinder.Eval(Container.DataItem, "Wmpho.Type") %>"><%# DataBinder.Eval(Container.DataItem, "title" ) %></a>
        </asp:Label>
        </ItemTemplate>
        </asp:TemplateColumn>
        </Columns>

The error I'm gettingi is this:

Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name Identifier.

Source Error:


Line 18: <asp:TemplateColumn>
Line 19: <ItemTemplate>
Line 20: <asp:Label><a href="wmpho-details.aspx?id=<%# DataBinder.Eval(Container.DataItem, "Identifier.systemid") %>&title=<%# DataBinder.Eval(Container.DataItem, "Wmpho.Type") %>"><%# DataBinder.Eval(Container.DataItem, "title" ) %></a>
Line 21: </asp:Label>
Line 22: </ItemTemplate>


Source File: c:\inetpub\wwwroot\wmpho2\webformwmphotest.aspx Line: 20

Any idea how I can try tell VS that that's a field name please?

Many thanks





 
Old December 3rd, 2005, 11:01 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If the source data is coming from a database query, you may best be able to solve this problem by using aliases on the field names.

SELECT Identifier.systemid AS systemID, ...

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bill printing problem in Dot Matrix Printer bhowmikp BOOK: Access 2003 VBA Programmer's Reference 2 April 17th, 2008 06:46 AM
Using variable as fieldname in SELECT statement elygp SQL Server 2000 3 April 26th, 2007 10:14 AM
Printing problem using dot-matrix paper size ismail_m HTML Code Clinic 1 January 1st, 2006 09:51 AM
Getting FieldName in a form tdaustin Classic ASP Basics 2 July 26th, 2004 06:55 PM
Mysql Latin5 FieldName and SQL Problem FWN MySQL 0 October 12th, 2003 01:40 AM





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