Posted on 2004-08-18
I have a DataList control to which I am binding a DataSet generated from an XML File.
The file structure is usually fixed, however, on occasion some Elements get missed from the document.
When I do the databinding, I (obviously) get the following error:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name Quantity
The line of code in the template causing the problem being:
<asp:label id=Label15 runat="server" font-size="10" Text='<%# DataBinder.Eval(Container, "DataItem.Quantity") %>'></asp:label>
What I'd like to know is:
a) Can I make some of the databound items optional, so if they are not present in the dataset they simply dont get bound?
b) Is there any other work around for this?
Theres a lot of fields in this document (30+) so I'd really rather not have to check for them individually if possible.