[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to pre populate sqlite databse in Windows 8.1 RT application(HTML,Javascript/WinJS)?

Posted on 2014-01-25
4
Medium Priority
?
789 Views
Last Modified: 2014-04-03
Hi All,

We are working on an app for Windows RT surface using HTML,Javascript/WinJS,CSS. For local database we are using SQLite3-WinRT plugin from https://github.com/doo/SQLite3-WinRT.

The SQLite database operations are working fine when we create db and its tables from the code,
but our requirement is to use an existing sqlite database and ship it with the application package(.appx) instead of creating db from code.

Could any one please let us know how to pre-populate an SQLite database file in a Windows 8.1 application?

Any code samples or tutorials would be really helpful.

 Thanks in advance.
0
Comment
Question by:dev-nbs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 47

Expert Comment

by:David
ID: 39809618
the sqlite database is a single file. Just build it as necessary and include the file and you are done.
0
 

Accepted Solution

by:
dev-nbs earned 0 total points
ID: 39814494
Thanks dlethe for valuable suggestion,

I got it solved by doing as follows:-
 
First i pasted my sqlite db in the project folder. Then in the db file properties set it to copy always.

Then for accessing the db file from JS/WinJS,  I have used the following code:-

var dbPath = Windows.ApplicationModel.Package.current.installedLocation.path + '\\mydb.db';

It worked! Now it is always copying my db file with application package and reading and updating data with the same sqlite db file.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question