G
Guest
Hi. I have a straight-forward "OleDbDataReader" object that's been returned
from a SELECT statement against an MS Access file. I've tested the DataReader
and it has data and is set up right.
Now I'm trying to use the ASP.NET Repeater WebControl to display the data. I
read the documentation and it says that in the <ItemTemplate> section of the
Repeater, I can use the following notation:
<ItemTemplate>
<%# Container.DataItem("LastName") %>
</ItemTemplate>
BUT when I do this, I get the following error:
"CS0118: 'System.Web.UI.WebControls.RepeaterItem.DataItem' denotes a
'property' where a 'method' was expected"
What does this mean? If I replace this notation with:
<%# DataBinder.Eval(Container.DataItem, "ID") %>
it works, but I've read that that's FAR less efficient. What am I doing wrong?
Thanks.
Alex
from a SELECT statement against an MS Access file. I've tested the DataReader
and it has data and is set up right.
Now I'm trying to use the ASP.NET Repeater WebControl to display the data. I
read the documentation and it says that in the <ItemTemplate> section of the
Repeater, I can use the following notation:
<ItemTemplate>
<%# Container.DataItem("LastName") %>
</ItemTemplate>
BUT when I do this, I get the following error:
"CS0118: 'System.Web.UI.WebControls.RepeaterItem.DataItem' denotes a
'property' where a 'method' was expected"
What does this mean? If I replace this notation with:
<%# DataBinder.Eval(Container.DataItem, "ID") %>
it works, but I've read that that's FAR less efficient. What am I doing wrong?
Thanks.
Alex