views:

1143

answers:

11

I'm going to be writing a Windows application using the .NET framework and C#. The application will need to store relational data which will be quieried, joined and processed.

Previously I've done this using SQL Server, but that is a total overkill for the application I am now making.

What's the simplest, easiest way to store relational data in my application? If I was on a Mac, I'd be using SQLite. What's the .NET equivalent?

A: 

I would say Microsoft Access. You need a licence though ...

Sébastien Nussbaumer
Access (*.mdb) files are outdated en deprecated. You don't need a license to use the underlying MsJet database though. Just for the Access application.
Henk Holterman
Henk, do you have a reference from MS where they say it is deprecated and should no longer be used?
0xA3
@divo, see http://msdn.microsoft.com/en-us/library/ms810810.aspx
Henk Holterman
+8  A: 

SQL Server Express is what you want. It's free IIRC and easily scales into full-blown SQL Server when required.

Andrew
And is included with a default VS install.
Richard
And it works with both LINQ-to-SQL and Entity Framework ;-p
Marc Gravell
Express is good, but it is not equivalent to SQLite.
Jon Rimmer
+3  A: 

Why cant you use SQLite? It works on windows. SQLite Quick start.

Also see here for getting it to work with .NET http://www.mikeduncan.com/sqlite-on-dotnet-in-3-mins/

So you could use SQLite if you wanted to but perhaps as others have pointed out SQL Express is a better option as you can upgrade to a full server if you need to in the future. Although from what you wrote i don't know if that's likely.

Kaius
Is there any benefit of SQL Lite over SQL Server Compact Edition?
Richard
TBH ive only played with SQLite a small amount. Im no expert in the advantages/disadvantages but i know it does work with .NET
Kaius
A: 

If not sqlserver express, You may want to conisder Microsoft SQL Server Desktop Engine ( scaled down version of sqlserver) which is free in most cases. or MySQL which is also free. I'prefer mysql.

Kalyan Ganjam
MySQL has some serious issues that had yet to be resolved last time I checked. SQL Server Express (or MSDE) is infinitely superior.
Andrew
MSDE has been replaced by SQL Server Express.
Jakob Christensen
MySQL will still require a server install and your left in a poorer situation in several ways (tools, mature features) than if you had gone with Express. It would add negatives without any positives.
Kaius
+3  A: 

Sqlite is definitely the best option for embedded database for application storage. It is free fast and reliable.

devdimi
+8  A: 

If you are using VS 2008 and .NET 3.5, you can use SQL Server Compact Edition. It's not really a server at all, it runs in-proc with your app and provides a basic SQL database. The databases themselves are a single .sdf file and are deployed with your app. Since it's part of the framework, it also means there's no additional installation. Actually, It's not actually part of the framework, but it's easily redistributable. I'm using SQL Server CE for a personal project I'm currently working on, and it's turned out great so far.

Jon Rimmer
A: 

You can use SQL Lite with .NET. In fact, if you are willing to keep your code so it can translate to mono, which encompasses most 2.0 (3.5 still upcoming), you can run your code on the Mac, as well, if you stick with SQL Lite:

http://mono-project.com/Main_Page

It really depends on how much bang you need. SQL Express, which has been mentioned numerous times in this thread, is SQL Server. It has some restrictions over full blown SQL Server, but it is the full SQL Server engine, so it is not a lite version, unless you think restricting a database to 4 GB makes it light. If you need heavier services like some Reporting, some message queueing (service broker), then SQL Express 2008 is your creature.

For lighter in the MS world, you can go with SQL Compact. As with SQL Lite, it is limited in scope, but you stated you need a lightweight database.

If you are really familiar with SQL Lite, I see no reason not to head that direction. Add a factory on top of your database access, just in case you change your mind. Then you will not have to rip up your entire app to switch databases.

Gregory A Beamer
A: 

SQLite

Firebird

MySQL Embedded

Sharique
+1  A: 

Microsoft JET Blue.

+1  A: 

you can use siaqodb - http://siaqodb.com .It is .net embedded database engine, very fast, small footprint, native LINQ query engine, it has features from relational databases like JOINs...

sqo
+1  A: 

I haven't used it yet but if I was making a windows application and needed functionality similar to this I would use the built in windows database that's already on every single box of windows.

http://www.codeplex.com/ManagedEsent

Chris Marisic