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.
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/
The DataSet from the .NET Framework is also an option. See DataSets, DataTables, and DataViews (ADO.NET) on MSDN.
Theoretical:
XML as Data Source
Manipulate XML File Data Using
C#
These projects will give you an idea
Roll Your Own Database
Using XML as Database with Dataset
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
-- EDIT: like #MathewMartin said: SqlCompact 4.0 is intended to be a web database and allows multiple connections.
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.
Check this Stack Overflow question: Free portable database
There you will find list of "lightweight" databases.
If you prefer object database, then consider using NDatabase.
Related
I am a winforms programmer and need to setup a data access website for our sql server database. The database contains weather data (wind, temperature, etc..). I would like users to be able to select a start and stop date and the to download the dataset. I know this should be simple to build, but I would like some advise on what is the best technique.
Do I need entity framework? We have a license for Developer Express ASP.NET. Any ideas to use, since I am totally confused about all the options available and I haven't build any ASP.NET website in a long time.....
Thanks,
Erik
For a first pass/prototype, I'd suggest you use ADO.Net and see how it runs with your datasets. Then, once things are clearer I'd maybe look into an ORM. Based on the use case you mention ORM might be overkill.
Yes with license for Developer Express ASP.NET. you can use Entity Framework
If you want work with ORM technology. mapping relational object; yuo have wizard who facilitate your cretaion of database and mapping
http://msdn.microsoft.com/en-us/data/ef.aspx
You can also use just ADO.Net with adapter of datas, stored procedure, dataset datatables, etc....
I am creating a ASP.NET application that is pretty much self contained, it will be pushed to different hosts and as a result will include an embedded database engine - I did look at SQLite but that can not run under medium trust and that could be an issue, so it looks like it is going to have to be Microsoft SQL Server Compact Edition 4.
Microsoft SQL Server Compact Edition does not support stored procedures and because of such I'm wondering where the best place to include the SQL code would be, taking into account future edits, etc.
So far I think that my options are either directly embedded in the code as a String or Stringbuilder type (which can get messy for advanced queries), or maybe in SQL files stored in the App_GlobalResources folder - the second option is something something that I have only just considered, but think that that would be a pretty good option for containment and future editing - does anyone have any other suggestions?
Regards, Nathan.
You can store parameterized queries in your resource file.
You can use MS SQL Express. It is free, it has stored procedures, but it has 4GB database size limit (increased to 10 GB for SQL Server Express 2008 R2).
For more information read this.
I think it's better to use some ORM tool or LINQ to SQL, than store native SQL strings.
Like other have said an ORM, Entity Framework or Linq to SQL is probably better than inline SQL, however as your question wasn't asking about any of these I would suggest storing you SQL files as embedded resources. Others have mentioned resource resource files but I feel that resource files are difficult to use and you do not have an nice IDE to develop within. Having embedded .SQL files should be easier to version control, use within Visual Studio, allow you to keep your queries as closely as possible to your data access components and make it difficult to change once in a production environment.
I've been looking into a lot of database's recently, and am not sure if it's because I'm bored or what, but I want to create a few web applications using database's other than MS SQL Server. Any suggestions that tie into ASP.NET nicely?
I'd recommend VistaDB and MySql.
I'd consider MySQL as the obvious alternative.
However, fundamentally one relational database is pretty much the same as another, more so when accessed through something like ADO.NET. If you're bored with SQL Server then rather than looking for an alternative why not look at trying different data access strategies?
You don't mention whether or not you're using an ORM (object relational mapper) which can make working with databases a lot more enjoyable than using standard ADO.NET, such as:
NHibernate
Entity Framework
Linq to SQL
Subsonic
IMO, sticking with SQL Server but trying out a few different ORM's would be much more interesting than switching to a different database altogether.
Or how about looking into using a document database, such as RavenDB?
I suggest you take a look at Connectionstrings.com. Most databases there have a .NET provider available.
Define "good".
Do you want to have a database as a simple data store, or should the database also implement business logic (stored procedures, triggers)?
Do you want to ship your apps and therefore require easy of installation?
Does it matter if the database is commercial, when MSSQL offers a free version?
As #richeym pointed out: are SQL statement a sufficient interface, or do you require an ORM?
I am wondering if it is possible to use Linq functionality to connect to a database like my-sql
If it is possible are you able to use the designer to created the DataAccessLayer like with MS-SQL or do you have to hand code its content.
Thanks in advance.
KJ
Linq to Sql only works with MS-SQL. Entity Framework can access several different database back ends and it fully supports linq. NHibernate can access more databases but it's linq support is not yet complete.
You could use IQToolkit.
Yeah check this out
http://code.google.com/p/dblinq2007/
There has been a few posts just recently on this too, just search on stackoverflow for more details.
Where can I get custom libraries for ASP .Net? Specifically I am looking for ready made database access library that allow me to select, insert and update a database using transactions. I know how to do create but I am trying to use an existent library that does all that and handles exceptions and errors so exempt from the hustle of creating that from scratch and go into errors.
You can use Microsoft's free Enterprise Library for DataAccess, Logging, Caching, Security and Configuration. It's very commonly used.
Also you can use code generators like free .NET Tiers, but you will need CodeSmith if you want to use it.
I'd suggest looking at either using LINQtoSQL and the DBML designer to map your database tables onto objects in your system or a more full-featured ORM, like nHibernate.
You may want to look at something called Speedy.net. I have never used it, but it looks interesting. I have used other code that these people have written, and normally it's pretty good. For the small amount of money that it costs it might be worth trying out.