views:

418

answers:

3

Good day!

I'm currently building a small website where I write down problems that arise and answers to them for others to see. Currently I'm using a DAL much like the one described here. Now I have been looking at other models, and in particular linq based models using Linq2SQL and the ADO.net Entries framework. I realize I'm moving the data access to the code layer in a way since I'm then filtering out for example a toplist with linq queries. The reason I started doing this was because the DAL was not really syncing up with the DB at all times and nullable types became not nullable when I changed something in the DB. Then if I would reimport the tables into the data table my queries would be lost.

My simple question is really, if you want a good DAL for ASP.net today, what would that be? Suggestions, experiences are more than welcome.

+2  A: 

There are many options and each of them might prove better depending on your specific circumstance. Some options include:

  • LINQ to SQL
  • ADO.NET Entity Framework
  • NHibernate
  • SubSonic
  • Writing one manually :)

My default choice is LINQ to SQL. It's a completely personal preference though. Many guys are NHibernate advocates.

Mehrdad Afshari
+8  A: 

I personally preffer LINQ to SQL and ADO.NET Entity Framework. Microsoft guys also use those technologies in their latest projects (take a look at KOBE project for example). Thus, Microsoft recommends those two as well.

Though.. sometimes I use Data Access Application block from Enterprise Library and manual DAL coding when I need maximum control over it's functionality and implementation.

Other alternatives are: NHibernate, SubSonic, different ORM solutions like LLBLGen Pro.


Great books on this subject:


Related tools:

  • LINQPad is also a great way to learn LINQ: it comes preloaded with 200 examples from the book, C# 3.0 in a Nutshell. There's no better way to experience the coolness of LINQ and functional programming.
Koistya Navin
I'm definitely gonna pick up a book about Linq to SQL. I started playing around with it and it looked very capable and as you say, MS use it themselves, but something told me it was bad to keep the db logic in the code, but maybe it's not such a bad idea after all. Thanks for the answer!
miccet
I do also think that it's not good idea to keep all db logic in code. I use stored procs with LINQ to SQL and Entity Framework by mapping them.
Koistya Navin
A: 

I'm using OPF3 for my current project, mostly because it has excellent support for Pervasive.SQL v9.5. The support is fantastic, as well.

David Brown
Does opf3 supports Oracle?
Amitabh
Yep! `Chili.Opf3.Storages.Oracle.OracleStorage` is an interface to `System.Data.OracleClient`.
David Brown