3

I am developing a small application with ASP and C# in .NET and I want to have a small local database next to it where I can save and retrieve records by either SQL queries or Linq queries. I don't need anything powerful, just something to use instead of keeping records in .txt files.

So what's your suggestion?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
chetan
  • 51
  • 3
  • 8

8 Answers8

4

Use SQLite

It does not have to be installed and is just a DB File and there are connectors to .Net available.

And you can use LINQ

Community
  • 1
  • 1
juergen d
  • 201,996
  • 37
  • 293
  • 362
2

I would go with either SQLLite or with XML since you are saying very small database.

And with xml you can use Linq to xml

Alex
  • 5,971
  • 11
  • 42
  • 80
  • 1
    XML files and XPath could be a great resource if you don't have many relations in your data. – nolith Mar 13 '12 at 08:44
1

I'll consider SQLite for this purposes.

If you are more comfortable with MS tools, or for some reason (i.e. your company already has a well formed mdb database file) you can use MS Access too, for local and small applications.

kappa
  • 1,559
  • 8
  • 19
  • 2
    I see absolutely no reason to use Access when alternatives such as SQLite are available. Free and so much better. I got bitten by MDB file limitations too many times. – Avner Shahar-Kashtan Mar 13 '12 at 08:06
  • I do agree with you, but often there are people not experienced with DB's and may find comfortable working with Access / MS solutions. – kappa Mar 13 '12 at 08:10
  • If people are inexperienced with DBs, using Access will keep them that way. I'd suggest diving in to SQL (in whatever flavour is preferred) as it's the only way to become experienced. – Dave Becker Mar 16 '12 at 15:24
  • 1
    I do agree with you too, but can anybody of you explain me why my answer is UNUSEFUL or WRONG. Everybody can have his design preferences, but using an ms access file in a small local application is not WRONG. Anyway since the feeling around here is this i'll exchange the order of my suggestions. – kappa Mar 16 '12 at 15:31
  • @Kappa fair comment. My view of access is very tainted indeed and I would never recommend it to anyone. That said, your answer was not WRONG per se, so I've upvoted. – Dave Becker Mar 19 '12 at 09:35
1

You can use SQL CE or SQLite.

RvdK
  • 19,580
  • 4
  • 64
  • 107
1

Best to use SQL Express edition since it comes for free. Try using .NET entity framework code first for rapid application development.

In any case application is very small consider using SQL express since you can write neat and clean stored procedures and can play with other database objects.

Please refer http://www.microsoft.com/sqlserver/en/us/editions/express.aspx for more details.

Shailesh
  • 1,178
  • 11
  • 12
0

In your case I would consider the following:

  1. XML if you don't with more than a couple hundred records in all tables. And @Ali mentioned already LINQ to XML what will be handy.
  2. VistaDB, because it's 100% managed code and require deployment of just one small assembly for both 32- and 64-bit.
  3. SQL CE, just because it's the most popular one. Of course, it supports LINQ and concurrency.
  4. SQLite as an alternative for SQL CE :)

Don't go with SQL Express unless it's been already provided by your hoster. It increases complexity of distributing/installing of your solution.

Alex Klaus
  • 8,168
  • 8
  • 71
  • 87
0

I recommend you to use SQL Server Express, becuase

  1. It is free to use and easy to install
  2. You can easily use either Entity Framework or LINQ TO SQL to manipulate your data
  3. It can easily communicate with your company's DB ( if it is also SQL Server), for example, one day in the future, you may need to test the replication.
Panda Zhang
  • 483
  • 3
  • 8
0

No one's mentioned it yet so here it is. mySQL and the .Net mySQL client.

Dave Becker
  • 1,433
  • 1
  • 12
  • 24
  • To be honest, if your small app is always going to be a small app then it doesn't really matter. However, if one day your app 'grows up' and the marketing department decide to make it the companies latest offering, then be careful if you go down the MS route. MS SQL Liceneses can be very expensive. – Dave Becker Mar 16 '12 at 15:27