In my SQL Server table there is a column slno. (yes, it contains a dot) that is working fine in SQL Server. However, <%#Eval("slno.")%> is giving an error:
DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name ‘slno’.
How can this be solved? I can’t change column name in database: I am getting data from stored procedure so I cannot modify it.
<ItemTemplate> <%#Eval("slno.") %> </ItemTemplate>
use
Alternatively use
For MSDN reference see http://msdn.microsoft.com/en-us/library/4hx47hfe.aspx
EDIT – Another option:
EDIT 2 – as per comments:
AFAIK
Evalhandles the string as an expression which it evaluates using some rules – these rules have special handling for the dot…GetPropertyValueOTOH does not apply those rules (which means it is NOT a full replacement forEvalAFAIK) thus having the ability to handle cases where the dot handling ofEvalleads to problems (like in this case).