Mike Burton
Mike Burton

Reputation: 3020

Are there any database-like persistence layers available for .NET?

I'm trying to tackle the problem of disconnected operation for an application with a relatively rich data layer, and it occurs to me that the most natural way to make this work is with a client-side database. I don't want to have to install a separate product, however, and I'm left to wonder if there are any layers out there where you can essentially link a database-like persistence layer into an application. Has anyone had any experience with this? Are there any good frameworks that cover this area?

Upvotes: 2

Views: 851

Answers (6)

casperOne
casperOne

Reputation: 74530

Are you looking for a database-like persistence layer because you want the query power of a database on the client side, or for persistence between application runs, or both?

If you need both, or just the persistence, then any one of the other answers showcasing integrated DB libraries will do (like this one for SQL Lite).

However, if the only thing you need is the ability to perform complex queries against in-memory data then I would highly recommend using plain-ol LINQ-to-Objects, assuming the option is available to you.

Upvotes: 1

LBushkin
LBushkin

Reputation: 131676

If you don't need the power of a relational database and want to simplify translation of your object model for persistence, you should look into DB4O - it's an object database that can run on your client and transparently persist your classes.

Upvotes: 4

Mark Seemann
Mark Seemann

Reputation: 233135

Even thought you don't want to install another product, you might want to consider SQL Server Compact Edition. Although you do need to install it, it's free, and installs no new Windows services.

The databases themselves are simply a single file per database. LINQ to SQL and LINQ to Entities are still supported, and you can even get a Windows Mobile version.

Upvotes: 2

dcp
dcp

Reputation: 55434

.Net has strongly typed datasets, which work great for this purpose. http://msdn.microsoft.com/en-us/library/esbykkzb%28VS.71%29.aspx

Upvotes: 2

Sergey Mirvoda
Sergey Mirvoda

Reputation: 3239

You can use NHibernate with sqlite or sqlce database. We use sqlce.

Upvotes: 2

Samuel Neff
Samuel Neff

Reputation: 74899

I would recommend SQLite. It's a full SQL database engine wrapped in a single dll with no installation or maintenance that just ships with your app and runs in-process. There's a great .NET wrapper that integrates nicely and allows you to create custom functions in .NET.

http://sqlite.phxsoftware.com/

Upvotes: 6

Related Questions