2

I've got Sqlite working in a basic sense for my C# project in Visual Studio 2008 via use of the ADO.net Sqlite wrapper from http://sqlite.phxsoftware.com/.

Question - For a C# winforms newbie what VS2008 data access layer approach would you recommend I look to use for my winforms app, as I need to write/read data from the sqlite database?

oezi
  • 51,017
  • 10
  • 98
  • 115
Greg
  • 34,042
  • 79
  • 253
  • 454

3 Answers3

1

How about using an ORM like Subsonic? SubsonicProject.com

Nils
  • 1,237
  • 3
  • 11
  • 28
  • I was thinking of one of the Microsoft approaches that is integrated with VS2008...(but I'm new to .net)...is there not a way in VS2008 to automatically create the C# wrappers to access the data in the database? – Greg Oct 09 '09 at 11:09
  • You mean like using Linq? Check out this related question: http://stackoverflow.com/questions/250071/linq-with-sqlite-linqtosql – Nils Oct 09 '09 at 13:59
  • yes - thanks, this is the kind of thing I had in mind - does this mean there is no Microsoft out of the box Linq To Sql for sqlite? – Greg Oct 10 '09 at 05:14
  • what about Entity Framework for example too? if there were sqlite support would this be any easier way to get a basic layer in place so I could work in the C# object world and not have to type SQL for my sqlite database? – Greg Oct 10 '09 at 05:24
  • Entity Framework is supported by the SQLite ADO provider. There are a few issues with it that can be worked around. See: http://stackoverflow.com/questions/936804/sqlite-with-entity-framework – Nils Oct 16 '09 at 09:46
1

I've found that the http://sqlite.phxsoftware.com/ works fine with Entity Framework. VS2010 doesn't seem to create the correct SQL for a "create DB from model" approach, however the "create Model from DB" approach works fine.

Greg
  • 34,042
  • 79
  • 253
  • 454
0

You might want to look at this lightweight SQLite wrapper, which has reflection-based ORM features, and some easy-to-use Linq support: http://code.google.com/p/sqlite-net/

It links directly to the released SQLite library, and has no other dependencies.

Govert
  • 16,387
  • 4
  • 60
  • 70