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.
Related Reading:
Other Interesting Posts
One Response to SqlHelper Source Code (MS Data Access Block)
Leave a Reply Cancel reply
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta








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!