views:

203

answers:

6

Is there some kind of simple database system that uses simple text or xml files for data storage? I just need some basic functionality like update,delete, insert, simple constraints and relations.

For the project that I have now using SQL Server would be too heavyweight and I have never really liked it anyway.

+4  A: 

Yes it is: SQLite :)

There is ADO Provider: http://sqlite.phxsoftware.com/forums/default.aspx?GroupID=2

There is article on that: http://www.aspfree.com/c/a/Database/Using-SQLite-for-Simple-Database-Storage/

dario-g
Nice, but can I integrate this into my ASP.net application? I am using shared hosting, does the server need to have it installed?
diamandiev
@diamandiev: No there is no need. You can use sqlite on your shared host.
Daniel Vassallo
How does this work then? If the server does not have the dll's do I need to just add them to the Bin folder?
diamandiev
Yes and this is just beautiful :)
dario-g
A: 

Theoretical:

These projects will give you an idea

Asad Butt
A: 

SqlCompact is a great option for this. There is no engine or setup, just include the .dll and you can create a database on the fly.

http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en

sadboy
Not working under IIS process by design.
dario-g
There is an override for it though. AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", True)
sadboy
Yeap. I forgot about it :)
dario-g
A: 

SQLite is a good option.

Since your using .net though, i'd consider just using xml and LINQ to XML, it's very sql like in many ways.

Paul Creasey
-1: It's like SQL, except for "some basic functionality like update,delete, insert, simple constraints and relations".
John Saunders
@john, only relational constraints are missing, everything else is possible in a simple and expressive manner.
Paul Creasey
@Paul: sorry, insert, update and delete are not "simple and expressive", as it's necessary to layer these concepts onto a sequential file format.
John Saunders
expressive might be a stretch, but it's certainly simple imo!
Paul Creasey
A: 

Check this Stack Overflow question: Free portable database

There you will find list of "lightweight" databases.

zendar
+1  A: 

The DataSet from the .NET Framework is also an option. See DataSets, DataTables, and DataViews (ADO.NET) on MSDN.

Jakob Gade
How about persisting the data?
HardCode
See the WriteXml method: http://msdn.microsoft.com/en-us/library/zx8h06sz.aspx
Jakob Gade
Ah, right. I forgot about that. Good idea. +1
HardCode