How do I use an MS Access database with the Compact Framework?
I am developing a Compact Framework a开发者_JS百科pplication that needs to manipulate an existing MS Access database. Apparently the CF has no support for Access databases, or even ODBC. How can I do this, without changing the database?
The answer, in short, is that you don't. The CF has no ability to attach to an Access database, remote or local.
Now if the database is on a PC, what I'd be inclided to do is create a simple WCF service that provides access (no pun intended) to the database by either exposing methods specific to your data domain (e.g. GetCustomerByID) or generically (e.g. ExecutSQL).
Doing so adds a lot of complexity, though, because now you don't jsut have the app, you have a service and the connectivity pipeline to maintain as well.
If there's any way around it, I'd sure try to get the data in a SQL Compact store.
精彩评论