5

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 queried, 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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Piku
  • 3,526
  • 6
  • 35
  • 38

11 Answers11

9

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

Andrew
  • 11,894
  • 12
  • 69
  • 85
9

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
  • 12,064
  • 2
  • 19
  • 19
  • 1
    I must add -- the SQLCE is a POS once you start to use it. Its limited, it has major errors when under high load. I don't even want to list out all the internal errors I have had using it these past 4 months. Came across this thread looking for a solution OTHER then SQLCE (3.5). I recommend that anyone needing a reliable light weight database NOT to use CE. I'm going to evaluate some now.. but I am just tired of the issues with CE. I was using it as a temporary place to hold high volume data before putting to the final resting places... Today -- cant stand it. Just my .02. – TravisWhidden Oct 18 '11 at 22:37
5

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

Also see here for getting it to work with .NET http://web.archive.org/web/20100208133236/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.

KyleSolo
  • 55
  • 1
  • 7
SecretDeveloper
  • 3,140
  • 2
  • 31
  • 36
3

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
  • 32,487
  • 24
  • 164
  • 258
3

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

devdimi
  • 2,432
  • 19
  • 18
3

Sql Server Compact Edition (*.sdf files). Small enough for Smartphones but also available on the full platform. The .net 2 version was called Sql Server Mobile.

Here is a comparison between Compact and Express.

H H
  • 263,252
  • 30
  • 330
  • 514
1

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
  • 16,870
  • 3
  • 25
  • 32
1

Microsoft JET Blue.

0

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.

kalyang
  • 209
  • 3
  • 12
  • MySQL has some serious issues that had yet to be resolved last time I checked. SQL Server Express (or MSDE) is infinitely superior. – Andrew Feb 21 '09 at 11:15
  • 1
    MSDE has been replaced by SQL Server Express. – Jakob Christensen Feb 21 '09 at 11:21
  • 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. – SecretDeveloper Feb 21 '09 at 11:23
0

SQLite

Firebird

MySQL Embedded

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
Sharique
  • 4,199
  • 6
  • 36
  • 54
-1

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

Sébastien Nussbaumer
  • 6,202
  • 5
  • 40
  • 58