Single-user database options

2020-03-24 04:18发布

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?

2楼-- · 2020-03-24 04:27

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.

3楼-- · 2020-03-24 04:29

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.

4楼-- · 2020-03-24 04:32

Microsoft JET Blue.

5楼-- · 2020-03-24 04:34

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:

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.

6楼-- · 2020-03-24 04:35

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

The star\"
7楼-- · 2020-03-24 04:40

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

登录 后发表回答