views:

127

answers:

5

I'm working on a little side project. I've got a large SQL query expression, 30+ lines, that I wish to use in my project. This app needs to provide read-only access to the database through these queries.

There are so many data layer choices. nHibernate, Entity Framework, LINQ to SQL, Datasets, Castle ActiveRecord... others I can't name off the top of my head. I don't want to have to recode this query into LINQ, so I think that's out. I'd prefer it if I could still copy it into a query editor or easily port it to some other framework.

This project is about learning a new technology. For the purposes of having a useful tech under my belt, which framework should I use? I will not, ever, update the database from this app.

Advice?

+5  A: 

NHibernate for the win!

Dead account
Can I use the SQL I have without having to make a NHibernate-style query?
yodaj007
Yes you can, but a week or two into the project and you'll throw away all your SQL and buy a T-Shirt which says "SQL is for chumps"
Dead account
And then you'd use Linq queries on top of that all over the place... :-)
Partha Choudhury
I like it when answers bear humor. And t-shirts.
yodaj007
+2  A: 

If you don't have a lot of queries to make and want the ease of use I would say take NHibernate (you have easier control on the mapping over XML) or even easier ActiveRecord (supposing you are also creating your own database, then you do not have really to care about the mappings).

Otherwise for performance use directly ADO.NET

jdehaan
A: 

With a large query expression, you could easily have several DAL projects and try out every one you've mentioned.

Austin Salonen
There will be other queries, of course.
yodaj007
+2  A: 

You want to write pure SQL but maintain portability - then iBatis is what you want: http://ibatis.apache.org/dotnet.cgi

jckdnk111
+3  A: 

SubSonic is nice and neat for simple things and even has a nice tagline (and podcast episode).

Ruben Bartelink
+1 even though it doesn't have the same Pzazz as the accepted answer :p
Dead account