G
George
All,
I have a data gid and I want the text of and ItemTemplate
asp:Label Field to be the value of a column from the DataReader which
the grid is bound to. HOWEVER, I need to do it dynamically as the
datareader may contain between 3 and 7 fields. This, I attempt to use
an IIF statement and only display a value from the datareader if there
are enough columns in the datareader. The line of code looks as
follows:
<asp:Label id=lblfield1 runat="server" Text='<%#
DataBinder.Eval(Container.DataItem.fieldcount > 2,
Container.DataItem.GetString(2), "") %>'>
When I run this, I expect to get the value of the third column
(getString(2)) from the DataReader if a third column exists
(Fieldcount > 2)
When i attempt to run this, I get the following error message:
The following error occurred: 5 - DataBinder.Eval: 'System.Boolean'
does not contain a property with the name Partial Payment Received *.
FYI 'Partial Payment Received *.' is the value of the third column in
the datareader.
Any ideas???
Thanks
George
I have a data gid and I want the text of and ItemTemplate
asp:Label Field to be the value of a column from the DataReader which
the grid is bound to. HOWEVER, I need to do it dynamically as the
datareader may contain between 3 and 7 fields. This, I attempt to use
an IIF statement and only display a value from the datareader if there
are enough columns in the datareader. The line of code looks as
follows:
<asp:Label id=lblfield1 runat="server" Text='<%#
DataBinder.Eval(Container.DataItem.fieldcount > 2,
Container.DataItem.GetString(2), "") %>'>
When I run this, I expect to get the value of the third column
(getString(2)) from the DataReader if a third column exists
(Fieldcount > 2)
When i attempt to run this, I get the following error message:
The following error occurred: 5 - DataBinder.Eval: 'System.Boolean'
does not contain a property with the name Partial Payment Received *.
FYI 'Partial Payment Received *.' is the value of the third column in
the datareader.
Any ideas???
Thanks
George