This would happen if the language you are using is C#. Replace
DataItem("Name") with DataItem["Name"] since DataItem is an array and is
referenced with square brackets in C#, instead of the curvy ones used in
Visual Basic.
Hope that helps,
--
--------------------------------------------------------
Peter Wright (
www.petewright.org)
Author of ADO.NET Novice To Pro
From Apress.
www.apress.com (and 10
other doorstops from Wrox)
"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
I have a book which shows that I can do Databinding to a control like the
following:
<asp:Label ID="lblScorecardCmntCategory" Runat="server" text='<%#
Container.DataItem("Name") %>'></asp:Label>
When I run this I get a error about, somthing about it was expecting a
method, not a property. DataItem is a method, is it not? If I use the
longer "eval" form, it works just fine, but I do not understand what I am
doing wrong with this "version" of databinding.
Can you clear up my confustion?