Problems faced in keeping SQL Compact Edition Database on another machine in same network

不羁岁月 提交于 2019-12-13 06:19:59

问题


I am using SQL CE 3.5 for one of my project, the front end is WPF application which process the given files and dumps the data to SQL CE database.

Presently application and DB is on same machine.

Client wants that he should be able to run the application from any machine on the network but database should remain on shared location of Server.

User will select the path to SDF file in the Application and then when any file is processed application will dump the data to database.

My question is, if keep SDF file on network shared location and access it from any machine then does it will work fine or could give problem?


回答1:


actually, it is not possible - SQL CE does not support network-hosted operations: everything related to the sdf-file (temp data) is recorded to the local machine, not network source, thus server is unable to process requests correctly.

You can use SQL Express Server that acts like data storage, for the local client the only thing you need is Microsoft Synchronization library 2.1 (it also works with SQL CE 4.0 SP1)

Summarising, create the SQL CE database, fill it with tables, index them, then port it to SQL Server express, add sync module to your app (in a separate thread ofc) and that's it.

Another solution is to use MS Access DB, which allows such mess, but it is incredibly slow not to mention no way to allow simultaneous writing to the db.



来源:https://stackoverflow.com/questions/16955184/problems-faced-in-keeping-sql-compact-edition-database-on-another-machine-in-sam

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