SqlHelper is part of the Data Access Blocks Released by Microsoft.

The Application Blocks created by Microsoft are "best practices" for each of the different blocks they have implemented.  The Data Access Block is meant to give you best practices to connect to Sql Server.

You can download the Application Data Access Blocks v2 here (installation + source code from Microsoft)

You can view the Source Code for SqlHelper here (online HTML format)

Here is the compiled ApplicationBlocks DLL and XML file incase you do not have permission to install or you only want the DLL+XML Documentation

In order to use it, either put the source code (.cs files) in your App_Code subfolder, or put the .dll in your Bin subfolder.

By using this intermediate layer between the database and your source code, you also have the option or ability to make system wide changes to the way your SQL connections are handled, which can come in handy in the future.

For example, you can add a line to your SqlHelper source to insert a record into a ‘history table’ of some sorts after every insert or delete operation.  If you are directly calling SqlCommand to insert, you will not have the ability to do that.

Enjoy :)
         

Other Interesting Posts

 

One Response to SqlHelper Source Code (MS Data Access Block)

  1. My partner and I simply need to express that I have found your website exceptionally beneficial! You have got so much insight as well as information and facts in this article which has aided me complete my school paper!

Leave a Reply

Your email address will not be published. Required fields are marked *

*


5 + = 6

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>