views:

159

answers:

6

What is the best free library in .NET to :

  • select, insert, update data in SQL Server with best performance (low level)
  • launch stored procedure
  • generate automatically object layer (1 object = 1 table) without relationnal link (foreign key is only id - 'int')

I don't want to use EF (very bad performance)

Thank you

+9  A: 

ADO.Net, which comes with the .Net framework, is your best bet. Visual Studio offers assistance in building data-driven apps using typed datasets via Dataset Designer.

The Entity Framework is included for building apps using a higher level of abstraction.

To me, it does not sound like your current requirements are complex enough to justify using other options. If you expect to expand and enrich this solution down the line it is worth evaluating one or more of them now, though.

Steve Townsend
But then, it doesn't really generate a full object layer.
tdammers
ADO.Net doesn't automatically generate an object layer (thankfully), but it does easily support handing out DataSets and DataTables, which can be altered and persisted back to SQL Server relatively easily (using data adapters, although this approach doesn't always work as expected). You could easily create your own class layer to sit on top of this, or just skip the layer and use the DataTables directly.
MusiGenesis
You can generate typed datasets and adapters using ADO.Net. You do this with the DataSet editor (Add New... DataSet) in conjunction with the Database Explorer.
Tergiver
@Tergiver- good point, pulled this up into the answer.
Steve Townsend
+1  A: 

BLToolkit. Look it up ;) Does NOT generate the dto's but performance is REALLY good.

TomTom
+3  A: 

have a look at NHibernate... a bit of a learning curve but it does all that you are looking for very effectively.

To generate your object layer, there are tools that will look at your database and try to do that for you. MyGeneration and CodeSmith are two that come to mind.

Chris Conway
I've heard that the performance of NHibernate are similar to EF...
Patrice Pezillier
well, it really depends on how you use it. If you have good strategies for lazy loading and caching, it can bring you to an enterprise level of performance very quickly.
Chris Conway
@Patrice seems like you want to add functionality to your data layer that will slow it down without slowing it down... If you want fastest possible data access, grab data readers and deal with the low level complexities. If you want abstracted objects, use an ORM. IMO, you'll be able to handle caching, maintenance, and optimization so much better after abstracting using an ORM that your performance will be better anyway.
marr75
I agree with what marr75 says exactly! DataReaders are the fastest but have nothing to do with generating objects. It's a tradeoff either way you look at it and I would choose ORM any day of the week.
Chris Conway
+1  A: 

What about Subsonic?

http://www.subsonicproject.com/

someoneinomaha
A: 

Use ADO.NET with Enterprise Library.

From Microsoft

The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development cross-cutting concerns (such as logging, validation, data access, exception handling, and many others). Application blocks are a type of guidance; they are provided as source code, test cases, and documentation that can be used "as is," extended, or modified by developers to use on complex, enterprise-level line-of-business development projects.

http://msdn.microsoft.com/en-us/library/ff648951.aspx http://www.pnpguidance.net/category/EnterpriseLibrary.aspx

If you want to generate entitiy classes for your db tables, try LINQ to SQL.

http://msdn.microsoft.com/en-us/library/bb425822.aspx http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

Shyju
EL is overengineered bloated
sirmak
A: 

Since you only care about SQL server, i think the best approach is to use Linq to SQL. You also get lots of extra stuff: lazy loading, caching, etc.

Icarus