{"action":"created","issue":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/300","labels_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/300/comments","events_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/300/events","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/300","id":93377978,"number":300,"title":"Implement prepopulation in visual studio cordova","user":{"login":"vioir","id":13207882,"avatar_url":"https://avatars.githubusercontent.com/u/13207882?v=3","gravatar_id":"","url":"https://api.github.com/users/vioir","html_url":"https://github.com/vioir","followers_url":"https://api.github.com/users/vioir/followers","following_url":"https://api.github.com/users/vioir/following{/other_user}","gists_url":"https://api.github.com/users/vioir/gists{/gist_id}","starred_url":"https://api.github.com/users/vioir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vioir/subscriptions","organizations_url":"https://api.github.com/users/vioir/orgs","repos_url":"https://api.github.com/users/vioir/repos","events_url":"https://api.github.com/users/vioir/events{/privacy}","received_events_url":"https://api.github.com/users/vioir/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-06T21:08:56Z","updated_at":"2015-07-07T12:37:46Z","closed_at":"2015-07-07T12:37:46Z","body":"I just installed the plugin in visualstudio in my cordova project , and i want to use prepopulation database in my project i put my database file (test.db) in www folder in project's solution \r\n![1212](https://cloud.githubusercontent.com/assets/13207882/8532847/58cb16ba-2446-11e5-919d-504410ae2340.JPG)\r\nwhen i try to use the following code: \r\n\r\n```javascript\r\ndocument.addEventListener(\"deviceready\", onDeviceReady, false);\r\nfunction onDeviceReady() {\r\n    var db = window.sqlitePlugin.openDatabase({ name: \"test.db\", createFromLocation: 1 });\r\n        db.transaction(function (tx) {\r\n            tx.executeSql(\"SELECT * FROM table1\", [], function (tx, res) {\r\n                console.log(\"res.rows.length: \" + res.rows.length + \" -- should be 1\");\r\n                console.log(\"res.rows.item(0).cnt: \" + res.rows.item(0).cnt + \" -- should be 1\");\r\n            });\r\n        }, function (e) {\r\n            console.log(\"ERROR: \" + e.message);\r\n        });\r\n}\r\n```\r\ni get the following error:\r\n![error](https://cloud.githubusercontent.com/assets/13207882/8533111/fa344340-2447-11e5-8a34-9ac0d4a8f83e.JPG)\r\n\r\nalso i get the error \"DB opened: somethingNotExist.db\" when i trying to open a database that is not in my project !!!\r\ni am using android emulator to debug the project.\r\ni checked my database file (test.db) it contain 'table1' table .\r\n"},"comment":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/comments/119191247","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/300#issuecomment-119191247","issue_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/300","id":119191247,"user":{"login":"brodybits","id":1559888,"avatar_url":"https://avatars.githubusercontent.com/u/1559888?v=3","gravatar_id":"","url":"https://api.github.com/users/brodybits","html_url":"https://github.com/brodybits","followers_url":"https://api.github.com/users/brodybits/followers","following_url":"https://api.github.com/users/brodybits/following{/other_user}","gists_url":"https://api.github.com/users/brodybits/gists{/gist_id}","starred_url":"https://api.github.com/users/brodybits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brodybits/subscriptions","organizations_url":"https://api.github.com/users/brodybits/orgs","repos_url":"https://api.github.com/users/brodybits/repos","events_url":"https://api.github.com/users/brodybits/events{/privacy}","received_events_url":"https://api.github.com/users/brodybits/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T12:37:46Z","updated_at":"2015-07-07T12:37:46Z","body":"> i do not want use it for windows phone application , i am trying to use this plugin for android application , i think it is ok with android apps , but i put the database in wrong folder\r\n\r\nThanks, happy you got it working.\r\n\r\nI would like to add this in case it will help some others: The \"Tools for Apache Cordova for Visual Studio 2013\" was OK for Android. I am still not sure if it will work for Windows Phone, as discussed in #237."}}