Using C#-SQLite with Silverlight

375 views
Skip to first unread message

VBCoder68

unread,
Apr 7, 2010, 4:03:54 PM4/7/10
to C#-SQLite
How should we make database calls in Silverlight projects? I noticed
that the Silverlight solution in the download does not have a
reference to the SQLiteClient project. Are we supposed to use
sqlite3_exec? If so, is this the way it will always work? Or, will
SQLiteClient eventually work with it.

Thanks,

Mike

Daniel Morgan

unread,
Apr 8, 2010, 8:21:43 AM4/8/10
to C#-SQLite
I personally do not use the silverlight project. I use the csharp-
sqlite solution and project, but I define SILVERLIGHT in the project.
I then add the SQLiteClient to the solution and build it.

If someone wanted to, they could port System.Data.SQLite to csharp-
sqlite.

Noah

unread,
Apr 8, 2010, 9:26:13 AM4/8/10
to C#-SQLite
I don't use the Silverlight project. Just included as a courtesy to
others.

If anyone want wants to submit a fully working project, I'd be happy
to include it as well

Noah

VBCoder68

unread,
Apr 9, 2010, 2:46:09 PM4/9/10
to C#-SQLite
I'd be happy to donate any code that you may find usefull from my
project once I complete it. Due to the time constraints on my
project, I probably won't be able to get SQLiteClient to work in
Silverlight this time around. That's mainly because I'm not that
familiar with C# SQLite yet. In fact, I just recently found out about
it when I was searching for a local data store to use with
Silverlight. I read the post by Kosenko Max on benchmarks. I was very
impressed by the OOB numbers. And, that's good because the
application that I'm working on is OOB.

As I said, I'm not that familiar with C# SQLite yet. So, is using the
sqlite3_exec method the best way to go? Or, are there other methods
that currently work in Silverlight?

Thanks,

Mike

> > Mike- Hide quoted text -
>
> - Show quoted text -

Daniel Morgan

unread,
Apr 10, 2010, 4:30:41 PM4/10/10
to C#-SQLite
SQLiteClient works. The problem with it running on sliverlight is not
the ado.net wrapper - SQLiteClient, it is the file locking in csharp-
sqlite. However, if you define SILVERLIGHT in the csharp-sqlite
project, it should work on silverlight. This is because defining
SILVERLIGHT handles locking differently. I think Noah can explain it
better than I can.

VBCoder68

unread,
Apr 20, 2010, 5:54:20 PM4/20/10
to C#-SQLite
I tried adding a SQLite Silverlight library project to my solution.
Then, I added the source files from the original SQLiteClient as links
and added a reference the SQLite.Silverlight project. When I tried to
compile, I got 184 errors. Most of them were along the lines of the
following.

'System.Collections.ArrayList' is inaccessible due to its protection
level
The type or namespace name 'Data' does not exist in the namespace
'System'
The type or namespace name 'IDbCommand' could not be found

I didn't see any compiler options within the code to get around using
the objects in System.Data. Am I missing something?

Thanks again,

Mike
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--
Subscription settings: http://groups.google.com/group/csharp-sqlite/subscribe?hl=en

Teravus Ovares

unread,
Apr 20, 2010, 6:00:37 PM4/20/10
to VBCoder68, C#-SQLite
I don't know if this is your problem, for sure, however..
previously when I got the message
'The type or namespace name 'IDbCommand' could not be found', it was
because I had the library configured for .NET 2.0. As previously
stated, the SQLiteClient project had support for .NET 3.5 only.

Regards

Teravus

VBCoder68

unread,
Apr 20, 2010, 6:16:08 PM4/20/10
to C#-SQLite
I have the Silverlight Target Version drop down set for Silverlight
4. Shouldn't that cause it to use the latest version of the
framework?
> > Subscription settings:http://groups.google.com/group/csharp-sqlite/subscribe?hl=en- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages