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

  • Thread starter Thread starter Georg Mayer
  • Start date Start date
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
 
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.
 
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.
 
Back
Top