tags:

views:

77

answers:

5

I am using C# in Visual Studio to modify an ASP web application.

The application is currently using SQL Server as it's database. SQL Server is way overkill for this application. We're talking 1 table, maybe 40 - 50 records, with maybe 2 add/modify/delete transactions a week.

I'd like to get the client off SQL Server, as they're paying a hosting company for it. Is there anything in the .NET arsenal that would allow me to do this simple db handling? (The hosting company does not support mySQL or Postgress)

+5  A: 
  • Sql Server Express - free but will need to be installed on the host
  • XML - free but will require code changes
  • Sql Server Compact Edition - free and may run on the host because it doesn't need a client
  • Sql Lite - free and should run the same way as Sql Server Compact
Bob
+1 for SQLite very good performance for little overhead.
mcauthorn
Although I like SQLite and Sql Server Compact Edition a lot, I still think straight object serialization best suits the OP's needs.
overslacked
Opps, I tried typing my links in by hand, thanks for pointing that out.
Bob
A: 

If the hosting company does not allow mysql, why would they allow anything ?

I like SQLite, it is a single file dll that creates and manages a database saved to a single file.

Also you might not need a db at all but rewriting the code to not use one will be tricky.

Karl
+4  A: 

I would use XML files. You can read and write to them. Here is an article from a quick google that will give you a start.

northpole
+1  A: 

Frankly, I'd do the whole thing in memory. Maintain the data in some appropriate structure (an array of records, or an instance of some appropriately designed class). Whenever the memory structure is updated do a quick save to disk so that you can correctly initialize the structure if you have to restart the application.

To save to disk, I'd just serialize the memory structure if that's easy in C# (I assume there's a built in pickling mechanism) or translate it to XML, or CSV, or whatever is appropriate.

Larry Lustig
A: 

Are they also using that SQL Server for other perhaps larger applications? Then I wouldn't mess with it.

If what you are contracted to do will not make major changes to the database, I would not redesign a working db becasue you think it is overkill. Certainly not unless the client specifically requested you to do so. Redoing this to another database may introduce new bugs, do you really want to go down that route if you don't have to? Is the client (who is paying the bills) unhappy with the current situation?

HLGEM