views:

44

answers:

3

I've been doing some research on finding an embedded database to be used with Silverlight/isolated storage. Everyone says SQLite will not work with Silverlight due to unmanaged code.

From my experience there is just a dll named System.Data.SQLite.DLL which I believe I either got from installed SQLite.NET or from the NHibernate build.

When configuring in c# code you can use a file based database and just specify a file to use.

So my question is where is the unmanaged code? And why wouldn't using file based database and writing it to isolated storage work? And now that Silverlight 4 supports OOB does that have any impact on this?

Answers appreciated ahead of time.

Regards

A: 

SQLite as downloadable from sqlite.org is written in ANSI-C (see the features page). That's what most people are thinking of when you say "SQLite" and it's definitely unmanaged code.

System.Data.SQLite.DLL appears to be "An open source ADO.NET provider for the SQLite database engine" and is "a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll if you're using it natively)" which seems pretty cool.

However, reading on, I see "The desktop native SQLite library and the ADO.NET wrapper are combined into a single mixed assembly" which seems to be saying that the DLL contains both managed and unmanaged code, which may be a problem.

Mike Woodhouse
Thanks Mike-I can test and see what happens...butI'm thinking the issue may be that ADO.NET is not yet supported via Silverlight. In which case the provider would not work...anyone know if ADO.NET is supported in Silverlight 4???
magellings
A: 

I'm not sure what features you need, but you might also want to check out Sterling

Sterling is a lightweight object-oriented database implementation for Silverlight and Windows Phone 7 that works with your existing class structures. Sterling supports full LINQ to Object queries over keys and indexes for fast retrieval of information from large data sets.

Here is the introduction blog post about this project.

Note: At the time of this post Sterling has not been released. You can download the source code though.

Andy May
A: 

There is no ADO.Net in Silverlight 4

chadbr