I’ve previously posted a few things about SQLite including a HOWTO on how to build from their source code. If you still want to build your own DLL from their source code that is totally fine, but not necessary in most every single case I’ve seen in app usage. One of the challenges I noted is that since SQLite is a native component and if you are a managed (.NET) app you can’t be architecture neutral anymore (AnyCPU). What this means is that you have to build your app for each architecture you want to support: x86, x64 and ARM. The flow of this using SQLite3.dll was that you would have to package, change the DLL, re-package.

Not anymore.

In working with the great folks on the SQLite team, they’ve packaged the binaries up (for Windows 8 apps) in a nice installer using the Extension SDK format. What this means is you now add a ‘reference’ to the SQLite binary and based on the architecture being built for your package, it will pull in the right DLL without you having to manage that yourself. Here’s some step-by-step…

Installing the SQLite for Windows Runtime package

The first thing you want to do is install the package. You can do this from within Visual Studio itself in all editions. From the Tools menu, choose Extensions and Updates and then choose the Online section (on the left of the dialog) and search for ‘sqlite’ in the search term. This will show you the SQLite for Windows Runtime package:

Click install my friends. You will be prompted to restart Visual Studio which you should do. Go ahead…I’ll wait.

Using the new package in your C#/VB app

Now that you have the SQLite for Windows Runtime package installed in your Visual Studio environment, you want to use it. In a managed (.NET) app you would do the following steps.

First, create your app (e.g., a Blank XAML app is fine). Once within your app, use the Add Reference mechanism to get to the next step. Now you will not be browsing for any DLL directly like you would in a traditional .NET. What we are adding here is a reference to the Extension SDK…not the library itself, a small but important distinction. Once in the Add Reference dialog choose the Windows\Extensions view (see on left) and you’ll see SQLite for Windows Runtime.

To correctly use this in a managed app you’ll need to select that *and* the C++ runtime as seen below:

The reason for this is to ensure that your app declares the right dependencies that are needed for the app to run. The likelihood of the C++ runtime not being on a Windows machine where your app will be installed is extremely rare, but you need to declare this anyway. Failure to do so will fail your app certification tests.

Now with this involved you can grab a managed wrapper to call the SQLite APIs as I’ve previously described in my HOWTO video. I personally recommend the sqlite-net library (available via NuGet) to make this easier for you.

NOTE: sqlite-net is available as source in C#. If you are using a VB app, you would first need to compile the sqlite-net source in a separate DLL so you can just add a reference to that in your VB project.

Using the sqlite-net library you can perform tasks using a model similar to LINQ2SQL where you can have types represent database entities:

Now you just need to specify your architecture for your app (x86, x64, ARM) and when you build, the appropriate sqlite3.dll will be packaged in your app automatically. This also happens during the packaging step for the store so the right item is included for each architecture-specific package.

WARNING: Do not package in DEBUG mode as you will fail certification. Ensure that you build/package in RELEASE mode prior to submitting to the store or running the app certification toolkit (also referred to as WACK in some places). You will get false positives if you are compiled in DEBUG mode.

This should make your development much easier without having to swap out DLL files each time.

Using the new package in your C++ app

If you are a C++ developer you will do the same steps for installing and adding as a reference to your app. In the C++ project system there is no 'Add Reference’ menu on the project context menu, but you will choose References and then the Add Reference button shows up.

Once you have the reference to the SQLite SDK then as a C++ developer you can just #include the header and go to work:

1:#include <sqlite3.h>

Since C++ projects are already architecture-specific you don’t have to worry about the AnyCPU situation because there isn’t one! You’ll get IntelliSense on the API by just including the header. The Extension SDK mechanism already includes the C++ props file to help the project system know where to get the header for development and the lib for linking when building. Most C++ developers will interact with SQLite using the native APIs and not need any additional wrapper library.

Using the new package in your JavaScript app

If you are using JavaScript/HTML to developer your app, you will follow the same flow as the C#/VB flow. Add a reference to both the SQLite SDK as well as the C++ runtime (to declare the dependency). As to accessing SQLite in your app, you’ll need a WinRT wrapper library to do that. The one that seems to be gaining favor is the SQLite3-WinRT library on GitHub. I have not personally used this, but seen a lot of people using this. It allows you to use the JavaScript programming model in a familiar way:

Summary

I’m very glad the SQLite team worked to get this deployment package out there. I think for some Microsoft developers, using SQLite is fairly new and this SDK package will make it easier to ensure you have the right bits at the right time. Of course you are free to do it your own way, but I think this will ease the process a little bit.

Why no NuGet? Well, the NuGet infrastructure right now doesn’t support some of these semantics around native components to deal with headers, linking and architecture-specific deployments. We’ll continue to work with them to see if we can drive these changes into that platform.

So please feel free to download via the Visual Studio ‘Extensions and Updates’ option from within VS, download directly from the Visual Studio Gallery, or download from the SQLite site themselves. Once installed, once an update is available, VS will notify you that an update is available and you can install it.

I added a reference for Sqlite for WINRT and C++ library but still i am not able to create a database in JavaScript app , it throwing "JavaScript runtime error: Class not registered " error how to fix this. plz help me out

@hbsp/alper - the SQLite3-WinRT library is a bit different as it compiles the SQLite bits directly in their lib. It would have to be slightly modified to work. In theory you could probably just use that library but would have to manage the different versions (x86/x64/ARM) building yourself.

If you do create table on person it should create the Address table too, and any select queries on Person would also return the associated address. I know EF/nHibernate do this, but unfortunately we don;t have System.Data anymore. Any ideas ?

Do any of you guys know if there is any way to generate C# classes from the SQLite database in Window 8 WinRT, or how to work with design-first approach (if I already have SQLite database I want to use in my Metro project)? Something similar to SQLmetal (for WP7 + SQL CE)? Tutorial on this topic would be nice!

Hi, You wrote above "NOTE: sqlite-net is available as source in C#. If you are using a VB app, you would first need to compile the sqlite-net source in a separate DLL so you can just add a reference to that in your VB project."

Can you explain how i got about doing this - i am quite new to SQLite and don't really know what i'm doing.

@Justin - if you are using a VB project for your *APP* then you'll need to create a C# class library, add the SQLite-net code to that (I recommend via NuGet), compile that as a DLL, then add a reference from your *APP* to your newly created DLL. The SQLite-net is only distributed in source and only in C# so if you are using VB, you'll need this extra step. Here's a compiled version demonstrating: http://sdrv.ms/NzgRlR

8/21/2012 2:32 AM | #re: UPDATED HOWTO: SQLite with Windows 8 apps//Question on how to use the sqlite-net library in C#:

Question on how to use the sqlite-net library in C#:I just successfully add reference to sqlite & sqlite-net to my Windows 8 style app project, and try the demo code in your description, and successfully create/insert new database/elements. Because I am not quite familiar with the sqlite-net API and DB operation, I hope you can show me a little more code using sqlite-net, how to query, how to delete, how to update ? Thanks so much >

@Michiel - actually this is due to the remote machine not having the debug version of the C++ runtime most likely -- are you using the VSIX installer? It should very much be deploying the sqlite3.dll -- just verified myself.

You wrote: "What this means is that you have to build your app for each architecture you want to support: x86, x64 and ARM. The flow of this using SQLite3.dll was that you would have to package, change the DLL, re-package."

I was struggling with this before I was referred to your article, and I worked out an alternate approach:

1.) Download the SQLite3 amalgamation and extract it.

2.) Create a C++ WinRT DLL project for the SQLite code, and remove the stub source files, headers, and precompiled headers. a.) Add the sqlite3.c, sqlite3.h, and sqlite3ext.h files from the extracted amalgamation to the project. b.) Open the property sheet for the project, set the scope to 'All Configurations' and 'All Platforms', and then update the following properties: i.) Disable precompiled headers. ii.) Add the preprocessor definitions: SQLITE_OS_WINRT;SQLITE_API=__declspec(dllexport)

I could then add a reference to the SQLite library project from my application project, and I can build and package for each platform and configuration straight from VS or using MSBuild.exe.

Yep, I only posted because I had come arrived at this just hours before someone pointed me at your page, so I thought I'd share the alternative.

Some other follow-ups on this:1.) I had another project that I needed to add SQLite to, so I tried out installing the extension as you describe above. Works like a champ, thanks!2.) Second the recommendation for SQLite-net if you need a really easy, lightweight marshaling between objects and SQLite.3.) One thing that didn't work with building the WinRT DLL from source was that I couldn't add it to my C# unit test class library, whereas there was no problem using the VSIX package.

I am a iPhone Developer and have used your Sqlite DLL on the Mac and iPhone products for some time. I have developed over 40 apps that are in the iTunes store. Sqlite on the mac works great.

All of these apps use Sqlite and I access data from built in calls to SQlite - such as sqlite3_prepare_v2 , sqlite3_bind_int. ,sqlite3_column_double and so on.

I am in the process of porting my apps to Windows 8 Metro and have been working with sqlite-winrt-3071300.vsix and have followed the instructions for using the layers sqlite3-net.

I am programming in vb.

I find that I cannot access the Sqlite at the same level I did for the mac , i.e. I have no access to sqlite3_prepare_v2 , etc... Whomever developed sqlites-net assumed users want to use Linq to Sql only. Using Linq to Sql I have determined would take a huge effort on my part and many others who want to port apps from other platforms to Windows 8.

Is there a way I can access the low level calls in your winrt version of the software so one can access the lower level Sqlite calls? Is there a work around? If there is then I can port my apps to Winrt with a reasonable amount of effort. There are many others in the same boat who may not want to use Linq.

I have tried to call directly the SQLite statements such as the Prepare through the Ling to Sql layer c code (SQLite.cs) and can't get it to work , it of course was not designed to allow me to do what I want in the code. Perhaps that code could be enhanced to allows users to directly asscess the SQLite statements at the low level directly.

@Jerry - you can get the *exact* same level of programmability you had with the other platforms you mentioned. The SQLite-net library is just that, a library. It is a community, open source project and as such was developed by individuals who scoped to the needs they felt. If you look at some of the methods you'd see that they do, in fact, call into prepare here. Additionally it provides you with the flexibility that if you do not want the LINQ experience, then you can simple execute commands at will using the Execute* methods. In the SQLite-net library the SQLite_prepare_v2 function is exposed as Prepare2.

I guess my point is this is the *same* SQLite you've been using. The library wrapper may be different and if it doesn't suit your needs, then don't use it. On iOS, given that it is a native platform and you're writing native code you were likely calling directly into the native APIs without a wrapper. You, of course, can still do this in a native app on windows without any wrapper required. .NET developers, however, aren't used to that and hence why you have a lot of helpful wrapper libs out there. If SQLite-net isn't doing what you need but you want to use it, I'd log a bug on the project, fork it and add the APIs you want, whatever.

Once I add references, I am getting error as below. Not sure What I am missing. According to this blog, this should support all build configurations.Please help me on this.

Error 1 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.VCLibs, Version=11.0". Please consider changing the targeted processor architecture of your project (in visual studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM". MyPasswordsDBError 2 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "SQLite.WinRT, Version=3.7.13". Please consider changing the targeted processor architecture of your project (in visual studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM". MyPasswordsDB

@Rosi - see my previous notes. You can't have an AnyCPU app with SQLite, you'll need to build for each architecture. When packaging this can be done in one step for you.

@Souch - there is a SQLite add-on to encrypt the database but I haven't tried it yet. My suspicion is that it should work, however may not pass store certification due to calling APIs that aren't approved for store apps.

@Joshueas - you are selecting all items immediately? and on the UI thread? if so, this would give your app the appearance of being UI locked. Depending on what you are doing you should reconsider what/when/how you are querying. Also, be sure to use transactions when running insert/update/deletes for better speed/reliability.

@Tim, yes, I'm trying to get essential data for the app's landing page. For testing, I've tried to reduce items in the database but with no luck -- poor results even with only ~100 records in the database in total. I've noticed main issue while creating connection to the database:

So if you are going to make more queries, with "connection per query" principle, you will get really slow application :( Is there any need for maintaining connections pool by the application itself or its handled by the sqlite "framework"?

Thanks fo your reply Tim.One more question.I am trying to create SqlLite database in the portable library. So that I can use the same assembly even for phone. But in portable assembly project, "System.Threading.Tasks;" namespace is not available.Is it means that, there is no way to create SqlLite db in portable assembly?

Hi TimI am trying to use SQLite-net in a background agent(in c#), from what I have read however due to the limitations in winMD projects this is not possible.is this correct?are there any ways around it?could I compile SQLite-net as a dll and reference it in the background task? (like you suggest to those who use VB)any help at all will be greatly appreciated.

Tim, are you familiar with how System Center can be used to deploy Metro apps? When we deploy our app using System Center, the SQLite dependency is lost (exception that program can't find sqlite3.dll). It's in the appx package and built in Release/x64.

9/12/2012 9:32 AM | #SQLite for Windows Runtime - not showing up in Extensions and Updates on my dev system

Just wanted to point out something that is probably obvious to all of you geeks out there, but you never know...I've got VS2012 installed on a Windows Server 2008 R2 PC (my dev platform of choice because I also do a lot of back-end dev). When I invoke VS2012 and then invoke Extensions and Updates, and then search Online for sqlite, daaadaaadaaa, SQLite for Windows Runtime does not show up in the list of goodies that I can install.

Is VS2012 so smart that it knows that I can't do Win8 dev using this instance of VS2012, so it's actually filtering the extensions that I can install? Or is there some other reason that I cannot find the SQLite for Windows Runtime in my list of installable extensions?

Nother question...when is Microsoft going to support Win8 development on non-Win8 PCs?

@magz - Are you not familiar with the SQL syntax? select column1, column2 from tableNamedelete from tableName where column1 = someValueupdate tableName set column2=someValue where column1=someOtherValue

I got the same error as Rajkumar. I added the reference to SQLite but there is a warning sign on it. Is this maybe the problem? But I don't know how to solve it. Still new with visual studio and app stuff cause I did only java things at this time.

Now I reinstalled the runtime package and recreated references. Now the warning sign is gone but still get the error:Error 1 The type or namespace name 'SQLite' could not be found (are you missing a using directive or an assembly reference?)

Problem: Warning sign on the included reference to SQLiteAs mentioned in the article you have to specify the architecture. In the build properties the cpu is default on "Any CPU". Choose one architecure and the warning sign will gone.

Problem: The type or namespace name 'SQLite' could not be found (are you missing a using directive or an assembly reference?) Make sure you have two new files in your project after installing sqlite-net (SQLLite and SQLiteAsync). In my case there went something wrong during installation so that these two files weren't added to the project beside it marked as installed. I created a new project and did the procedure again... then it worked.

Hopefully it saves somebody some time. It got me hours to figure it out.

Hi Tim,Nice post helpful.But I install SQLite (Version=3.7.14) following the steps in the blogspot in a new project. Debugging is set to Release but when I try to run the project i get the following errrorError : DEP0700 : Registration of the app failed. An internal error occurred with error 0x80073D05. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. (0x80073cf6).Mis I something?

When I follow the steps for a C# Windows Store app using VS 2012 RTM on Windows 8, the 'Add Reference...' dialog does not show "Microsoft Visual C++ Runtime Package". I'm not sure why nobody else is seeing this. I installed Visual Studio 2012 RTM using the defaults.

After doing a clean re-install of Windows 8 (which I needed to do anyway as it had accumulated 3 years of cruft) and VS 2012, the 'Add Reference...' dialog now shows the "Microsoft Visual C++ Runtime Package" option. Definitely wasn't there before.

Hi, I am developing a note taking app. User will write note and he can set some metadata like location, note date time, etc. I am using SQLite for metadata and note will be RTF file. Now I want to have skydrive sync for that app. So user can access/backup/restore notes and its metadata from any Windows 8 device. I can upload and download files easily, but what approach should I use to sync the SQLite database ? Please guide me with some sample code.

When I try to install this from the extension manager I get a web request exception. If i try and download and install from the web page it gives me a "The file is not a valid VSIX package" and the log contains :

Regarding the missing 'sqlite3.dll' when remote debugging with a DEBUG build, other than installing Visual Studio 2012 on the remote machine, is there another option to get the VC++ RT debug version installed on the remote machine so I can debug a DEBUG build?

managed to do it through the manager in the end. It was a permissions error with my new RTM machine!!

BTW one more question, can I use the same sqlite3.dll and reference it from normal .net projects, or do I need to recompile it? If so please say you have it (x64) already compiled. I know I could install the ado sqllite thing, but i don't want to, I want to use the library (sort-of) direct like the way with this metro extension does.

Tim - are there any recommended strategies on how to sync my Win 8 app (using SQLite) with the database hosted in Azure? I want my users to be able to access their data from either a Win 8 app or from an ASP.NET web app. At the same time, I want to allow users to interact with the Win 8 app even when not connected to the internet. So if I use SQLite (on the client), I need a way to sync up that data with the SQL database in the cloud when the app is connected. Thanks.

First, thank you for your article. I have a question about transactions. I use SQLite for JS and before using the SQLite dev team component this was working : db.runAsync("BEGIN TRANSACTION;", []); . Now I use the component and the new version of SQLite3JS and it's not working anymore. Are they any plans on getting this feature ?

First thanks for the article - I've yet to get it working in VB.Net but give me a couple of hours and I'll get there.Professionally as a seasoned .NET developer of 15+ years (I actually had the first asp.net e-commerce site in the UK) - it's crap that MS don't allow us to reference SQL Server (even if only the express editions). I have a MAJOR multinational who want's to use Metro for the next implementation of their app (which uses SQL Replication), and I can't access this major functionality! Who's idea was that? Is WinRT only for the likes of Angry Birds???? There are big companies out there willing to pay money for applications developed to work on phone, tablet and laptop with the same look and feel across all platforms.

OK - the majority of apps won't use SQL Server, but please give us the option of using System.Data.SqlClient if we need it. There are some of us out there that need this functionality! We also have the IT depts. to do the necessary installation of the SQL Express editions on the tablets to support the application (private - not downloadable from the store)

It seems that WINRT is targeted solely at "iStore" type applications, and completely ignores those of us who develop applications for third parties on a bespoke basis which aren't available to the general public. Are Microsoft trying to deliberately dumb down the development process?

I know I can use a standard desktop app - but this isn't what the client wants. They want a full-screen metro-style app with all the functionality of a local SQL Server. A very big banana skin as far as I'm concerned. Even SQLCE integration would have worked, but as usual, Microsoft knows best and completely ignores their core developers. Maybe it's time to move to a different platform and dump Microsoft altogether!

Hi Tim! Great Post... I'm having a problem with the package certification, I have SQLIte in a class library to separate data access from the front end... however I keep failing the certification kit because of the dependency with the VC++ framework.. the error is the following:"My App takes a dependency on Microsoft Visual C++ Runtime Package framework but is missing the framework dependency declaration in the manifest."

I don't know what to do... do you know how to fix this? I've already tried adding the dependency declaration on the manifest but it fails because I'm not providing the framework within the app...

Guys,I appreciate Tims article and all of your comments. I am like Ric with a Server 2008 R2 (I like it), wanted a sqlite friendly platform, tried my VS Express tools and Extensions no luck saw that there was a licence issue. I then installed VS 2012 went to get sqlite not there again. (Server 2008 R2 is not too different from Windows 7 so I thought that people were fooling me). Ric made me believe again.We are both linking a mobile device with the web.I then found dotconnect. I then went searching for samples. I found this a buggy sample code.msdn.microsoft.com/.../Discussions - disasterAbout this time I searched to find your article - sane people. My objective is to have a website with a sqlite backend. Any tips beyond this excellent article?Thanks

Hi,Great post and a really useful library. It's live now on my app on the W8 Store ... but there is a problem. The 'example code' at the top will not work if the user's name contains a non-ASCII character (for instance, an accented character).The line: var db = new SQLite.SQLiteConnection(dbPath)) will throw an exception ('Could not open database file').In Win8/RT you can reproduce this case by creating a new user (but not associating it with a LiveID at this stage) and giving a user name that includes an accented character. Then, logged on as that user, build and run a project as described in this article.The code will try to create a DB file in C:\Users\(user name)\AppData\Local\Packages\(package name)\LocalState\db.sqlite, and will throw an exception. As far as I can see, a valid path is being passed into the sqlite3_open entry point, which expects a UTF-8 encoded string, but somewhere after that it all goes horribly wrong.Any ideas? This is going to be an issue for *ANY* app in the store that uses SQLite, so I hope there is a solution.Thanks,Jim

Hi Tim - Thanks to your guidelines I got a head-start on using SQLite, before it was available through NuGet. Now I want to port my Metro application from Windows 8 to Windows Phone 8. I have installed sqlite-net and the SQLite extension. But the sqlite.cs won't compile. Because of the WINDOWS_PHONE / USE_CSHARP_SQLITE compiler directives references to Community.CsharpSqlite now comes to live. But this namespace is not found in the project. How do I add it?

Just had 2 questions:1)How to specify foreign key relationships between tables.. I came across Sqlite.Indexed attribute which does the same thing but it doesn’t specify which table it indexes..2)Can we use the same for an WPF app??

I have a critical question considering SQLite. I developed an app and inserted some data into a local SQLite database. Pretty easy, pretty fine. Then, I just changed my splash screen image, selecting a different file from Package.appxmanifest. The database content was lost.

Does this mean that when I update an app, my users will lose all their saved content? Thank you in advance.

Vangos, That depends on how you packaged the db file, if its set to content and you selected Copy Always then yes, it will overwrite all the time. If Copy if newer is selected then it won't overwrite all the time.

Hi Tim,Blog is very helpful. I have query related to Unicode data. I am able to store and fetch the Unicode data in the SQLite table. But when I tried to search from table using WHERE clause which contains Unicode data like below - cmd.CommandText = "SELECT * FROM Event WHERE Name LIKE '%" ++"%'"List<Event> events = cmd.ExecuteQuery<Event>();result no data. Please help.

i add sqlite to my project as you suggested,it works well at the beginning.but when i add a new class library to my project,and i reference sqlite in the library ,and then declare new class using sqlite primarykey.i use this data class in another project of a same solution,after i create and add element to database,all the item has the same PK which is 0.why？helo me, thanks.

Thank you so much. I followed your article and it took 5 minutes to get set up and another 5 to write a few lines of code. This is exactly what I was looking for. Since I'm on an 86 machine, I had to set my project to target that. I assume the packaging part for the windows store will be self explanatory once I reach that step.

HI Tim, Thanks a lot for such great article, its helps. to let you know i am nowise to this platform. i was earlier used to work with .net but never used JavaScript with SQLite. My Problem.

i am creating one form like registration and i wanted to store all things in SQLite. how can i ?, i know this is very basic Question but even i am asking cause i m eager learn this thing with JavaScript.

hi.. i'm developing a windows store app and i'm in confusion in choosing the backend...I ve no idea abt the databases...so please suggest me a backend tool..and also I wanted to know the difference b/w SQLite and LINQ...Thanks in advance

Exception was thrown at line 227, column 5 in Function code0xa0040005 - JavaScript runtime error: The text associated with this error code could not be found.WinRT information: The text associated with this error code could not be found.

Hi ,I want to create a table at run time using SQLite where I would be giving the table name and column name dynamically. Is it possible to create and insert new columns dynamically?Kindly help me with the code.

Hi,I have been working with the Sqlite Database on the Windows 8 App.Turkish character problem when I insert or select the database.How can I fix this problem. can you help me?Thank you very much.Easy come.

Thank you for your detailed information and instructions. I wanted to add Sqllite as the database to my windows 8 app. I am new in creating apps. Where am I supposed to add the package(coding) that you have listed in the beginning. Should i have add in the sqlite reference or somewhere else.. Please kindly help me. I am desperate in adding a database to my metro app.. Eagerly waiting for your reply.

Looks like a great tutorial. Thought it would be a great tool to get a feel for VS since I have never used it before and wanted to take a peek at it. I downloaded and installed the iso for VS Express 2012 for Desktop. I went to the TOOLS->Extensions and Updates and searched for SQLite after selecting "Online". The returned result is "No Items Found". I can search and display other packages. The VS install apparently installed the NuGet manager. I used the console and searched for the SQLite-net package and found it, but still could not locate any SQLite runtime. I know it must be something simple, but I am at a loss as to how to get the runtime package installed.

@Aravind - the main reason you get this usually is wrong architecture for the sqlite3.dll (e.g. you have a 32-bit DLL in a 64-bit app) or you have an older version of SQLite3.dll that doesn't have the SetDirectory API in it (which means you'd have a really old version)

@Sergey - if you hover over the yellow exclamation mark it should tell you why. My assumption is that you are trying to reference an older SQLite package on an app that targets a later version. If you are building a Win8 app you need the Win8 version, Win8.1 needs the Win8.1 version. Both are available for download on their site at SQLite.org/downloads.html in the Windows Runtime section.

For those working with Visual Studio 2013 (aka Version 12) - you won't find the package add the in the Visual Studio Gallery. But you can find it here: www.sqlite.org/2014/sqlite-winrt81-3080403.vsixDownload, rename to vsix if needed, install and be happy :-)

No problem. I am writing a blog about using database in windows store apps, so just to wanna make sure I don't write something wrong. I have another question. As far as I understand, we can connect our apps to sql server database using wcf. Is that a problem when we publish our app?

@hatice - yes you can access your SQL database via WCF. In doing so you are essentially using a service-based architecture, just like accessing a web service from some other 3rd party. What you cannot do in the store is direct line-of-sight database access like ADO.NET.

Following the setup instructions in the above Github page, I have done the following:-1)Added SQLite3Component\SQLite3Component.vcxproj to the app's solution using FILE > Add > Existing Project..2)Added reference to SQLite3Component to app's project using PROJECT > Add Reference > selected SQLite3Component

When I run the example given in the github page it is asking "would you like to debug SQLite3Component - Debug Win32 project". I gave yes and it is giving me two errors.

Hi Tim, great posting in fact this seems to be the only thing I can find to access a db in win rt. Where can I find documentation on how to select from the db? intellesence is telling me there is no "select" after I enter db. only query method? I need to populate a combobox with db values is this hard to do?

@Jasmin - I don't understand your question -- you would use VB code to write your app in your case. If using a SQLite library, then you'd want to use a compiled version (or compile it yourself). This is not difficult to do.

@Lyle - it depends on the library you are using to call it -- if you look at this example, I use SQLite-net and it provides a LINQ-like query language on top or you can call the Execute method and pass in a SQL statement.

Hi Tim,Handy article - thanks. However what is the recomended approach to utilising database connections?Do we have one connection for the whole app, or a new connection with "using" per database access>For example,1. On startup:SQLiteAsyncConnection conn = new SQLiteAsyncConnection( "mydb.db" );then use conn for all accesses.2. using(SQLiteAsyncConnection conn = new SQLiteAsyncConnection( "mydb.db" )){ // access database}The majority of examples I've seen propose approach #1, but a couple (the minority) including an early code snippet in this article suggest approach #2. The SQLiteAsyncConnection class doesn't seem to implement IDispose so is #2 approach actually needed? Or have I missed something fundamental?I'm solely using the async API in a universal app (mainly for Windows Phone, but soon to be for tablets too).Many thanks,Clive

Name (required)SubjectE-mail (will not be published)WebsiteRemember Me?Please enter your comments