tags:

views:

26

answers:

1

Say I have a table name is MyData, the I have a column have the same name MyData. so the table looks like

MyData(ID, MyData, Col3, ....)

Using EF and Ria Service to get data from DB and bind data to a datagrid like:

<data:DataGridTextColumn Header="ID"  Binding="{Binding ID}" />
<data:DataGridTextColumn Header="MyData"  Binding="{Binding MyData}" />
<data:DataGridTextColumn Header="Col3"  Binding="{Binding Col3}" />  
...

then run it, I can get all data displayed for all other columns except MyData column. Nothing displayed for Mydata.

How to resolve this problem?

A: 

It looks like you have an object called MyData and then a property with exactly that name, try change the name of your table and see if it works...

Tony
Thanks, guys. Figured out reason. EF generated Entity MyData and change the property name MyData1, not MyData. So when binding data, should use Mydata1, not MyData.
KentZhou