0
votes

One of the ambition of business application is to allows multiple users running the application at the same time to manage huge of data. How do I get the latest version of data from the database with using WCF RIA Service? I have tried to use the DomainCollectionView to display list of Product, and allows to perform search, but unfortunately, the search results display on the client is still the old version if I have modified the product name or product code or deleted records directly from the database by using SQL Management Studio or changes made by another user. To get the latest version of data, I have to refresh my browser. Sounds like the data are cached on the client side already. Please advise.

Attached with my coding file using AdventureWorks as a sample, please navigate to the ProductPage and try to type something on the search box.

http://www.mediafire.com/?l4aee46y3vljuv7

Thanks.

1
What exactly is not working for you? It is working fine here, load the page, change a product name on management studio, navigate to other page and when back to the other the updated data was on screen. Can you tell what exactly are the steps to reproduce the problem?Leo
Problem is here "navigate to other page and when back to the other the updated data was on screen". I'm using DomainCollectionView approach, I want to get latest version of data from the database when performing search. Example if I have changed a product name or deleted a product on management studio, I want the client get the search results with the latest version of data without refresh the page.Calven Yow
DomainCollectionView is implements server-side filtering right? Why the search results not the latest version from the database if without refresh the page?Calven Yow

1 Answers

0
votes

In the LoadProductSummaryList method, change the line

Return context.Load(context.GetProductSummaryListQuery.Where(Function(p) p.Name.Contains(SearchText))

to

Return context.Load(context.GetProductSummaryListQuery.Where(Function(p) p.Name.Contains(SearchText)), LoadBehavior.RefreshCurrent, True)

The data will be refreshed as per your needs.

Hope this helps...

Chris Anderson