Solved

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

Posted on 2014-01-25
4
759 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:dlethe
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

738 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