WinRT / Metro for Release Preview

129 views
Skip to first unread message

GuyJ

unread,
Jun 17, 2012, 10:27:18 PM6/17/12
to csharp...@googlegroups.com
I spent most of the day today trying to use the WinRT version of the code from the hg repository.  I thought I must be doing something stupid because I couldn't make it work.  Now I realize that the stupid thing that I was doing was not having tried the included test project first.  After resolving the xaml and metro helper class changes introduced in the RC I found that the samples are all broken too.

In the test application it is getting an error saying "unable to open database file"  or SqliteSyntaxException with "no such table TEST_TABLE"

I don't have much of a clue as to what the cause is, but in MY use case (an existing db) it appears that the ultimate error that is occurring is in the btree_c.cs file and the lockBtree function.  There it does some voodoo to determine if the file is a valid sqlite file and fails with SQLITE_NOTADB. I've confirmed that the db is ok by copying the file from my localstate directory and opening it using the firefox SQLite Manager tool without problems.  I checked it's integrity and even vacuumed it and reintroduced it with no luck.

I realize that this code is based on Metro Beta code so I'm not here to complain.  I'm just curious if anyone else has taken a look at this yet and has any idea what is going on.

Michael Schoneman

unread,
Jun 19, 2012, 3:11:12 PM6/19/12
to csharp...@googlegroups.com
I think I've got the issue fixed in my local code.  I have to rework the test program, but once I get that done I'll send Noah a new diff so he can incorporate it into a new release.

GuyJ

unread,
Jun 19, 2012, 5:06:41 PM6/19/12
to csharp...@googlegroups.com
That is awesome.  Thanks for the help.  Just out of curiosity, is it reasonable to ask what you found?  I'm assuming that it was I/O related, but to be honest the code for this beast is hard to wrap my mind around.  (Just to be sure I don't offend anyone with that "beast" comment, I'm not saying it is in any way bad.  It is just overwhelming and, because of it's C roots, not written like your typical c# app.)

There are a lot of people out there wanting to port WP7 or Windows apps to Metro.  This project should be of great benefit for all those people out there wanting to leverage existing code.  I still don't understand why MS thinks that there is no place for database access in Metro.  This project not only addresses that need, but does it with a pure .Net implementation that keeps it architecture neutral.  If I understand the situation correctly, there is an official Metro/WinRT sqlite version in the works, but it is not managed code so you would need separate builds for ARM and Intel Metro apps (See http://timheuer.com/blog/archive/2012/05/20/using-sqlite-in-metro-style-app.aspx).

Sorry, now I'm rambling.  Bottom line, thank you!

Michael Schoneman

unread,
Jun 19, 2012, 5:27:36 PM6/19/12
to csharp...@googlegroups.com
Besides all the issues caused by the changes from Consumer Preview to Release Preview, there was an issue with the amount of data written not getting calculated correctly.  

Michael Schoneman

unread,
Jun 19, 2012, 5:48:36 PM6/19/12
to csharp...@googlegroups.com
Looking at the official version, I see some interesting things with regards to WinRT.  It looks like Microsoft added quite a few function that can be called from Metro apps that weren't there in the Consumer Preview.

I'll get my current code cleaned up and off to Noah and then see if I can add additional functionality (like locking) that wasn't supported before.

tempy

unread,
Jun 20, 2012, 1:28:34 PM6/20/12
to C#-SQLite
Michael - thanks again so much for your work. I'll be able to simply
lift an entire persistence layer out of WP7 and plunk it into a Win8
app, so this is a huge deal for me.

I've also attempted to hack on CS-Sqlite myself and got lost very
quickly, so cheers.

Please do update us when your changes have been merged in!

Michael Schoneman

unread,
Jun 20, 2012, 4:19:45 PM6/20/12
to csharp...@googlegroups.com
I can't speak to when it will be merged in, but I sent the diff file to Noah today.

GuyJ

unread,
Jun 20, 2012, 7:09:35 PM6/20/12
to csharp...@googlegroups.com
I just looked and I see that it looks like the changes are merged already!

tempy

unread,
Jun 26, 2012, 10:57:06 AM6/26/12
to C#-SQLite
I put it through its paces and so far it seems to work perfectly in my
Metro app. Thanks so much!
Reply all
Reply to author
Forward
0 new messages