0
votes

I'm trying to use the sqlite-winrt library at https://sqlwinrt.codeplex.com (cf. http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/05/30/sqlite-winrt-wrapper-for-windows-phone.aspx) because I need to access an SQLite database via SQL commands in a WinRT 8.1 and a WP8 app and this library seems the only available option.

Anyway, there is no binary release and if I try compiling the source I get several link errors for unresolved externals against the SQLite DLL. I posted an issue at codeplex but got no reply yet, so I was wondering if anyone had already managed to successfully compile this lib and how (or if you know of any viable alternative for RT8.1 and WP8). Here is what I did:

  1. downloaded the latest source from the site.

  2. downloaded and installed 2 VSIX from http://www.sqlite.org/download.html: sqlite-winrt81-3080002.vsix for RT 8.1 and sqlite-wp80-winrt-3080100.vsix for WP.

  3. executed the powershell scripts in each subfolder of the source code solution, which are required to update the projects with newer releases of the SQLite for WinRT extension. The current versions of the scripts refer to SQLite for WinRT 8.1 (prerelease) which is the same I downloaded above.

  4. opened the VS2013 solution and removed the RT project (I just need RT8.1 and WP, this was for WinRT 8.0).

5) built the solution, which failed with link errors.

If I see the RT8.1 project properties, I can confirm the reference to SQLite is under C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\SQLite.WinRT81\3.8.0.2. Did anyone manage to use this lib? Thanks!

2
This is probably not why you are having issues but just a quick reminder to unblock the zip file before extracting the content.Iris Classon
Yeah thanks, I'm accustomed to do this for each downloaded source, or you usually get annoying read-only related files complaints from VS :). Still looking for a solution to this, it seems strange nobody is (directly) using SQL with SQLite :)...Naftis
That stuff is seriously hairloss promoting. as for the Q, I've used SQL lite with no problem in a winrt app, but not 8.1, and not with that particular approach. Here is an older post I wrote on this: irisclasson.com/2012/10/02/… check out step 12 for async wrapper. Not sure this is what you are looking for, but it might be good for something.Iris Classon
You're right... Anyway, I need to use SQL because I need joins and in a case even dealing with complex SQL queries directly generated by a library (no ORM there); it seems that such a trivial thing is not yet supported out of the box, and the only library I found is the one I quoted. I'd not like to reinvent the wheel just for this purpose.Naftis
Well, there isn't and won't be support for SQL server connections, not compact or express. The apps aren't meant to be used that way. The recommendation is to use services and small local storage for offline use between syncs. SQLite support however is good for that scenario and does work well. timheuer.com/blog/archive/2012/05/20/… Its basically what I did in my post, but more detailed and better explained. Read the comments for more info on his blog. SQL is not trivial for heavily sandboxed environments AFAIK. Use a service and serialize offline.Iris Classon

2 Answers

0
votes

I also once had that problem. I fix it by editing the project file manually. At that time, the powershell script updating the wrong path. That's why I always failed when compiling my project. After I edit the project file using external text editor (I use sublime text), the projects are linked correctly.

-3
votes

You can try DatabasesCx. It is another SQLite Wrapper using Windows Runtime Component technology. It is freeware distributed as precompiled binary. You can find the details at http://www.almanacsoft.com/databasescx