Quick C# prototype program with simple DB


Okay, I've seen but haven't programmed in C# before. You can assume I'm competent in C++, and advanced in C (for what good that'll do me). I understand inheritance, polymorphism, etc so OO concepts aren't going to be a huge problem.

Let's say I've been given a task to prototype a quick and dirty program that won't be much different than what I could do in access in a short time.

  • It'll have a DB with 5-6 tables (mostly small, a few with have several thousand rows but only 4 or so columns, etc)
  • I'll need to have forms generated dynamically from one of the DBs
  • The results of the forms will be stored in another table
  • The DB isn't multiuser

Basically your run of the mill access app... except without access. I'm sure I can muddle my way through and create horrendously bad code, but I'm equally sure lots of people here can give me a push in the right direction (tutorials, wizards, info, differences and killers moving from C/C++ to C#, etc).

Is there a simple DB I can plug in to get started aside from mdb, or is that the best choice for this particular nail? I'm aiming for a quick and dependency-less install.



If concurrency is not an issue, then I'd say go with SQLite. An ADO.NET provider can be found here: http://sourceforge.net/projects/sqlite-dotnet2/files. As for the concurrency issue, when performing a bunch of inserts, that operation needs to be enclosed within a transaction. However, that transaction places an exclusive lock on the database until the transaction is either commited or rolled back. At least that's been my experience, but I've only been using it for a week or two myself.

Hope that helps!

By : pkspence

I would suggest using SubSonic to generate your data access code and scaffold your screens.

SQLite is exactly what you're after. It's a C library for accessing a file based relational database. The referred site has full visual studio support (System.Data.SQLite).

By : jarrodn

This video can help you solving your question :)
By: admin