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

G

Georg Mayer

Hi,
I am trying to display data from a DataSet in a Repeater Control.
My item-template (just an example) is like this:
<ItemTemplate>
<td>
<asp:Label Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "item.Name") %>' ></asp:Label>
</ItemTemplate>

The problem, in my opinion, is that in my DataSet I am using alias
names for my tables. One alias is 'item', as you can see above. And
that's where I get the exception, i've already tried it without alias
and there isn't any.

Does anyone know how to access colums with table names?

Thank you in advance

Georg
 
M

Marina

I believe you need to specify an underlying datatable.

You can do this one of 2 ways, set the datasource property to the datatable
instead of the containing dataset. Or, in addition to setting the
datasource property the way you are, also set the datamember property to
specify which datatable.

Basically, I don't think you can bind to a dataset only - because then there
is no way to know which table you mean to use as the source for the rows.
 
G

Georg Mayer

I am selecting everything in one table, which is the default table of
the DataSet and is going to be used when no other table is specified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top