Can a silverlight client access a local sql compact database that is stored in isolated storage

家住魔仙堡 提交于 2019-12-13 16:44:20

问题


Does the silverlight clr support access to a sql compact database placed in the silverlight application's isolated storage?

If so, any pointers to code samples.

I would like to cache information retrieved from the server in previous sessions.


回答1:


Even if it was stored in Isolated Storage, there is no Silverlight library to read in SQL Server Compact Edition. Perhaps in a future version. I have heard of a couple of open source projects that are trying to do this but there are not any that have releases yet. I tried to wrap the Google Gears DB in Beta 2 to no success.




回答2:


There is no SQL client for silverlight. Also the user can delete your data from Isolated storage - right-click the running silverlight app and go to the "Application storage" tab. So just use it for user settings and for cached data that the app can work without, even if it is slower.

If you need to cache data locally, your best bet is to store it as XML in the isolated storage, reading and writing it using LINQ to XML.

If there's too much data for this, or the data is too complex to make this easy, then keep the data on your server and the silverlight client should then just access it over the net.




回答3:


It's probably worth mentioning that this is now possible using Silverlight 4's COM capability but only when running Out Of Browser.




回答4:


I have a sample here, using SQL Server Compact and Silverlight (OOB and elevated and on Windows only) - http://erikej.blogspot.com/2010/02/access-local-sql-compact-database-from.html



来源:https://stackoverflow.com/questions/331857/can-a-silverlight-client-access-a-local-sql-compact-database-that-is-stored-in-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!