Mobile Zone is brought to you in partnership with:

Developer enthusiast since the young age, my passion is mobile development and, in the last years, I focused on the Windows Phone platform. I'm engaged in many activities for Italian communities by blogging, writing articles and speaking about Windows Phone development. I'm member of the Italian community DotNetLombardia. Since 2012 I'm Microsoft MVP in the Windows Phone Development category and, actually, I work in Funambol as a Software Engineer for the Windows Phone and Windows 8 platforms. Matteo is a DZone MVB and is not an employee of DZone and has posted 26 posts at DZone. You can read more from them at their website. View Full User Profile

SQLite For WinRT Available on Visual Studio Gallery

09.05.2012
| 4247 views |
  • submit to reddit

Thanks to Tim Heuer I’ve found that there’s an easier way to add SQLite to your Windows 8 application rather than the manual one described in my post. Now SQLite for WinRT is available as a Visual Studio extension, you can simply add it by searching for the keyword sqlite: the name of the extension is SQLite for Windows Runtime. Once you’ve installed it and restarted Visual Studio, you can now simply add SQLite to your application by adding a reference to two of the available libraries in the Extensions panel: Microsoft Visual C++ Runtime Package and SQLite for Windows Runtime. You can access to the panel by right clicking on the project, choosing Add reference and selecting Extensions from the Windows menu.

SNAGHTML12499e4

SNAGHTML125199d

Be aware that, since the library uses C++ extensions, you can’t compile the application using as a platform the Any CPU option, but you should target a specific platform. To do that, open the Configuration manager from the Build menu and set the platform to one of the available options (x86, x64 or ARM).

SNAGHTML1270275

If you don’t do this, you’ll see a warning sign on the two references Microsoft Visual C++ Runtime Package and SQLite for Windows Runtime and the project won’t compile.

image

And… you’re done! No more manually downloading the dll library and copying it to the Visual Studio project: you can simply go on, install sqlite-net and use the same code you’ve learned to use in my first post.

Thanks to Tim Heuer for the tip and… happy coding!

Published at DZone with permission of Matteo Pagani, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)