?
Solved

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

Posted on 2014-01-25
4
Medium Priority
?
777 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
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.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Suggested Courses

771 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