Using Microsoft Application Blocks for Increased Productivity

Microsoft has published several Application Blocks for public use. These Blocks are designed to be best practices for common development scenarios. A list of the current Blocks can be found Here. These classes are designed to be dropped into a development environment with little modification. One of the most commonly used Blocks is the Data Access Block. This set of classes encapsulates a large majority of the ADO data access functionality into easy to use, robust, efficient, safe, static methods. Using this class, you do not have to worry about explicitly opening and closing connections and it even takes care of Stored Procedure Parameter caching for increased ADO to SQL speeds. Below is an example of code that uses the Data Access Application Block. As you can see, a separate method is created for caching the parameters of the stored procedure. You will also find that each of the static methods have many overloads. In the case of the Data Access Block, each method can take either a connection string or a transaction object as an input for connecting to the database.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.