Saturday, February 25, 2012

Silverlight RIA Services - Records count mismatch

Team,

I was working with a Silverlight application which was fetching SQL data using RIA services. While coding I observed that the total number of records in the SQL data table is not matching with the records count in the Silverlight application.


After several debugging hours I found out a very crucial behavior.


All these tables that are coming in through RIA services need a primary key. If there is no primary key then the RIA services might try to pick a unique column on its own. But it’s always a hit and miss. So it’s better to make sure every table even every view that is being fetched through RIA services must have a “Unique Key Field”.


Hope this helps and saves time.


Happy Coding!

Cheers
Anand

No comments:

Post a Comment

All Blogs so far ...