views:

625

answers:

8

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.

Thanks!

+1  A: 

If you already have MS Access installed, then yes the mdb is probably your quickest way to get started.

Also you will want to just started with a quick ADO.NET tutorial. There are hundreds of these (well almost hundreds, I haven't counted).

Sam
+2  A: 

It sounds like for this app, you could use Microsoft Dynamic Data or Castle Active Record, and have the application working a few minutes after you finished the database. These tools connect to a database and generate forms for inputing data. Take a look at them.

Access is probably your best choice for database. MS Sql 2005/2008 Express would also work well, but that would require an install.

NerdFury
+1  A: 

How about using SQLlite instead of access for db? I have never used it but have heard that its good for some light weight and quick db tasks.

blntechie
+2  A: 

If you're programming in C#, Visual Studio comes with an added install for SQL Server Express. If you're looking to get something up quick and dirty, it would pretty easy to leverage that database in building your app.

japollock
+1  A: 

SqlExpress would be your best bet, simply because you already have all the support that you need in System.Data.SqlClient. Other then that, there are some decent help on the MSDN.

MagicKat
+1  A: 

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).

jarrodn
+1  A: 

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

Paul Dolphin
A: 

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!

pkspence