Hi all,
I am facing a problem with databinding in a gridview. Im converting an XML result into a dataset and then databind the table to a gridview.
gvResults.DataSource = DSjoinTable.Tables["DOCUMENT"].DefaultView;
gvResults.DataBind();
To show the column values in the gridview I use:
<%# Eval ( "LASTAUTHOR") %>
However, Im receiving the error
DataBinding: 'System.Data.DataRowView' does not contain a property with the name LASTAUTHOR
if this field does not exists in the table and thus does not exists in the XML. Can I catch this exception in the aspx page in the EVAL statement and print N/A for example?
The problem is that I don't have control over the XML so I dont know on forehand if the field exists or not in the XML.
Many thanks for any input.
Leo
I am facing a problem with databinding in a gridview. Im converting an XML result into a dataset and then databind the table to a gridview.
gvResults.DataSource = DSjoinTable.Tables["DOCUMENT"].DefaultView;
gvResults.DataBind();
To show the column values in the gridview I use:
<%# Eval ( "LASTAUTHOR") %>
However, Im receiving the error
DataBinding: 'System.Data.DataRowView' does not contain a property with the name LASTAUTHOR
if this field does not exists in the table and thus does not exists in the XML. Can I catch this exception in the aspx page in the EVAL statement and print N/A for example?
The problem is that I don't have control over the XML so I dont know on forehand if the field exists or not in the XML.
Many thanks for any input.
Leo