views:

268

answers:

2

Hi friends I would like to know the difference between "sqlhelper class and data acsess application block". When I googled for sqlhelper calss some links are directing me to "access application block" like http://msdn.microsoft.com/en-us/library/ms954827.aspx. which is best to use. Thanks.

A: 

You should probably look at EntLib 4.1, which is the latest version.

http://msdn.microsoft.com/en-us/library/dd203099.aspx

I'm not familiar with the SQL Helper class. The Data Access Block is really designed to make calling stored procs easier. You can read more about it here:

http://msdn.microsoft.com/en-us/library/dd203144.aspx

Ade

Ade Miller
A: 

I think the goal of a sqlhelper/dbhelper class is to cut down on trivial tasks when communicating with a database. Tasks that you have to do every time you wanted to communicate such as opening and closing a connection etc

The Data Access application block is just a Microsoft version of a sqlhelper class although they've put a lot of effort into creating a standard and for it to work against many database types etc A sqlhelper class is likely quite a small part of the Data Access application block

Here's a link which contains the latest Applicaton Blocks as the link in your question has a much older version... http://msdn.microsoft.com/en-us/library/cc467894.aspx

The Enterprise Library also has other application blocks for things like Exception Handling, Logging and Caching...

You would probably have to investigate how the Enterprise Library would fit into your project before deciding to use it...It may well be overkill for a very small project...But knowing and understanding it will help you if other projects are using it or need something similar. You may well change jobs and find that the next projects you work on are already using it...

davidsleeps