This project is read-only.

unable to use sqlite-winrt on Windows 8 consumer preview

Mar 27, 2012 at 3:44 AM

I was successfully using sqlite-winrt on Developer preview, but not able to do the same on windows 8 consumer preview.

I get the error " The specified procedure could not be found".

Please let me know if somebody has used the same without any problem on windows 8 consumer preview.

Mar 28, 2012 at 1:37 PM

I can not compile it on the consumer preview.

I installed the VS 2011 beta and it does not have a platform.winmd file can you help me with this.

Thanks

Mar 29, 2012 at 10:12 AM

I downloaded the files from the url

https://bitbucket.org/MnemonicWME/sqlitemetro/wiki/Home.

Compiled the same in Consumer preview (make the project platform 64 bit) and change the project output to winmd files from the project property page.

Now i am able to use the sqlite winrt on consumer preview.

Thanks.

Mar 29, 2012 at 4:29 PM
I also changed and compile my code using SQLiteMetro.
It is running but the database file is not created.

public class SRDatabase

{

static Database mDatabase;

static public SRDBUsersTable UsersTable {get;set;}

static public SRDBAdminTable AdminTable {get;set;}

const string mDatabaseName = "SRBionessDB.sqlite";

static string mFullPathFileName;

static SRDatabase()

{

//StorageFile file;

try

{

mFullPathFileName = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, mDatabaseName);

mDatabase = new Database(mDatabaseName);

}

catch

{

}

if (mDatabase.IsReady)

{

Init();

}

}

Is ready returns false. And all the every access to the database fails.

Can you please help me with this.

The same code worked with sqlite-winrt on developpers preview.

Thanks

Ofe


From: nijain [notifications@codeplex.com]
Sent: Thursday, March 29, 2012 11:13 AM
To: Ofer Ebert [Bioness Neuromodulation]
Subject: Re: unable to use sqlite-winrt on Windows 8 consumer preview [sqlwinrt:350139]

From: nijain

I downloaded the files from the url

https://bitbucket.org/MnemonicWME/sqlitemetro/wiki/Home.

Compiled the same in Consumer preview (make the project platform 64 bit) and change the project output to winmd files from the project property page.

Now i am able to use the sqlite winrt on consumer preview.

Thanks.

Mar 30, 2012 at 4:02 AM

Please try giving the database name along with the local folder path while creating a database. I had also faced the same problem. Once i gave the full path, isReady became true.

Mar 30, 2012 at 3:07 PM

Yes, nijain is right. Change the code to:

mDatabase = new Database(mFullPathFileName);

SQLiteMetro behaves differently from sqlite-winrt. It let's you specify the entire path, while sqlite-winrt always uses local data folder.

Apr 12, 2012 at 3:12 PM
Edited Apr 12, 2012 at 3:18 PM

I'm trying to use SQLiteMetro:
1 - I downloaded the files from the site
2 - I compiled the project sqlitemetro
3 - I created a new Metro project, I changed the project output to winmd, and platform x64
4 - I added sqlitemetro.dll to the new projectbut if I try to add a reference to the dllI have an error:

A reference to 'C: \ Users \ .... \ SQLiteMetro.dllCould not be added

 

Apr 12, 2012 at 7:10 PM

We are going to release a new, unrelated working winrt component on github soon. Expect it next week. It includes tests and uses the newest sqlite version.

Phil 

Apr 13, 2012 at 3:42 AM

I have been able to use sqlite-winrt successfully in my project on CP successfully.

Try adding the reference of winmd file to your project.

Let me know if it does not work, I can attach my sample project for your reference.

Apr 13, 2012 at 9:36 AM

@phil_ke:  ok, you can let me know when there are news?

@nijain: I tried adding the reference of winmd file, but when I add the reference to sqlitemetro.dll, get the same error. can you attach your project ? 
thanks 

Apr 15, 2012 at 8:36 AM

You should not add a refference to sqlitemetro.dll only to sqlitemetro.winmd the .dll file should be in the same folder as  the .winmd file it works for me.

Apr 16, 2012 at 8:52 AM
Edited Apr 16, 2012 at 8:53 AM
OferEbert wrote:

You should not add a refference to sqlitemetro.dll only to sqlitemetro.winmd the .dll file should be in the same folder as  the .winmd file it works for me.

Hi, thanks for the help, I tried the example on the site:

using SQLiteMetro;

// create/open a database
Database db = new Database(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "myDatabase.sqlite"));

Statement stm;

// create db schema
stm = db.PrepareStatement("CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, data BLOB)");
stm.Execute();
stm.Dispose();
...

but seems that the reference "using SQLiteMetro" isn't sufficient! 
The database class is recognized, but the method prepareStatement isn't recognized
Apr 16, 2012 at 9:37 AM

Function names are case sensitive. Use the lower case like prepareStatement, execute etc..

var stmt = db.prepareStatement(query);

if (stmt.isValid) {

stmt.execute();

do {

} while (stmt.getNextRow())

}

}

Thanks,

Nikita.

From: tommy86r [email removed]
Sent: Monday, April 16, 2012 1:22 PM
To: Jain, Nikita
Subject: Re: unable to use sqlite-winrt on Windows 8 consumer preview [sqlwinrt:350139]

From: tommy86r

OferEbert wrote:

You should not add a refference to sqlitemetro.dll only to sqlitemetro.winmd the .dll file should be in the same folder as the .winmd file it works for me.

Hi, thanks for the help, I tried the example on the site:

using SQLiteMetro;
 
// create/open a database
Database db = new Database(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "myDatabase.sqlite"));
 
Statement stm;
 
// create db schema
stm = db.PrepareStatement("CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, data BLOB)");
stm.Execute();
stm.Dispose();
...
 
 
 
but seems that the reference "using SQLiteMetro" isn't sufficient !
The database class is recognized, but the method prepareStatement isn't recognized
 

Apr 21, 2012 at 3:59 PM

when I do start the project, I get this error:

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

on this line: Database db = new Database(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "myDatabase.sqlite"));

if I change the project output to winmd, I get any error, for example::

Error 10 Type 'ProvaSQLiteMetro.Common.RichTextColumns' contains externally visible field 'ProvaSQLiteMetro.Common.RichTextColumns.RichTextContentProperty'.  Fields may only be exposed by structures. C:\Users\Tommaso\documents\visual studio 11\Projects\ProvaSQLiteMetro\ProvaSQLiteMetro\Common\RichTextColumns.cs 45 51 ProvaSQLiteMetro

Apr 23, 2012 at 3:39 AM

Is your app and sqlitemetro built with different project settings? Both should be built with either 32 or 64 or Any CPU project settings in the configuration manager.

May 14, 2012 at 7:34 PM
Edited May 14, 2012 at 7:35 PM

anyone know if SQLiteMetro supports Foreign key constraints?

 

I tried this:

stm = db.PrepareStatement("CREATE TABLE IF NOT EXISTS Category (Id TEXT PRIMARY KEY, FOREIGN KEY(IdImage) REFERENCES Image(Id)");

but it does not work

Jun 26, 2012 at 11:00 AM

I have download SQLiteMetro,but  when  I compile it,it  has error:“ error C3952: 'Platform::Array<__TArg,__dimension> ^' : WinRT does not support 'in/out' arrays. Use 'const Array<>^ for 'in' and 'WriteOnlyArray' or 'Array^*' for 'out' on public APIs.' c:\users\来\desktop\mnemonicwme-sqlitemetro-4fa0918a6a77\mnemonicwme-sqlitemetro-4fa0918a6a77\sqlitemetro\statement.h 35 1 SQLiteMetro

can  you  give  me  some  advice?  thank  you!

Jun 26, 2012 at 11:34 AM

I think it don't work on Relase Preview...

work to anyone?

Jun 26, 2012 at 12:10 PM

@oppqw: You should use the Release Preview ready, async version of an SQLWrapper from https://github.com/doo/SQLite3-WinRT

This version here on codeplex is outdated and not maintained I fear. This particular error you are getting comes from the Release Preview WinRT compiler beeing more restrictive with incoming arguments.

Jun 26, 2012 at 5:30 PM
Edited Jun 26, 2012 at 5:31 PM

I forked and fixed, it was passing the tests a couple of weeks ago ... 

https://bitbucket.org/timbielawski/sqlitemetro

 



Jun 27, 2012 at 5:33 AM

ok,thank  you~  now  I can  use  it.

Jun 27, 2012 at 3:56 PM

@oppqw:  have you been using SQLite3-WinRT?

Jul 26, 2012 at 7:50 AM

hi

I am facing following error,  can any one help me how to reslove this An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) when it reache to

SQlite.Database db = new SQLite.Database("bookdb");

Jul 26, 2012 at 8:10 AM

Is your sqlite and application build with the same configuration? (both should be build with either x_64 or x_86)