advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
DataRow Parameters
Exception Management Application Block
Partners & Affiliates
advertisement
CoDe Magazine
Subscribe to CoDe Magazine
Average Rating: 4/5 | Rate this item | 1 user has rated this item.
 Print Print
 
Data Access with Microsoft Application Blocks
Microsoft has created a set of libraries known as Application Blocks which help developers reduce the amount of code they must write—while using current best practices. One of the components, Data Access Application Block for .NET, addresses Microsoft SQL Server data access by wrapping up data access into a helper class. 

advertisement
icrosoft recently launched the Microsoft Patterns and Practices section of their Web site, offering several complete architectural and design application blocks, complete with source code, that you can use in your .NET applications.

When Microsoft introduced .NET, they introduced a new data access architecture called ADO.NET. This new data access architecture is the next evolution from COM-based ADO. ADO.NET provides a lot of new features for accessing data such as datasets, which are essentially an in-memory database, and data adapters that allow different data providers to interact with a DataSet. This model allows datasets to be completely data provider-independent giving you the option of changing the data provider used to fill a DataSet and update data from a DataSet. You can even use multiple data providers with a single DataSet—fancy that! Of course you will find some classes such as a Connection class, Parameter class, and Command class that perform the same basic function as their ADO predecessor. With ADO.NET's new features and enhancements, of course, comes extra complexity when you write your data access code; you never had to deal with a data adapter in the past. Wouldn't you like someone to encapsulate all that complexity into a series of classes and methods to handle 95% of your data access logic needs? You're in luck.

Microsoft has introduced the Patterns & Practices Web site, which contains Microsoft's suggested practices and design patterns guidelines for designing, developing, deploying, and managing the life cycle of software solutions. The Patterns & Practices Web site contains the following four types of methods for sharing these guidelines: (design) Patterns, Reference Architectures, Reference Building Blocks and IT Services, and Lifecycle Practices. Together these guidelines provide far better guidance for developing strong solutions compared to simple white papers or books alone.

The Reference Building Blocks and IT Services guidelines provide designs and components for building reusable sub-systems in your software solutions. The components of this guideline are referred to as Application Blocks. Table 1 lists the eleven Application Block components that were available at the time this article was written.

Table 1: Current Application Block components available at the time this article was written.

Application Block

Description

Aggregation Application Block

This Application Block contains a component that sends requests to a series of dispatchers to return data from various service providers in a single data entity such as a dataset or XML document.

Asynchronous Invocation Application Block

This Application Block manages asynchronous communication between an application and service providers.

Authorization and Profile Application Block

This Application Block gives you the ability to manage role-based authorization and profile information in your applications.

Caching Application Block

This Application Block provides an infrastructure to cache data from service providers such as a Web service or database.

Configuration Management Application Block

This Application Block provides a simple and consistent interface for reading and writing application configuration data.

Data Access Application Block

This Application Block contains a component that has functionality to simplify the most common methods for accessing Microsoft SQL Server database servers via the .NET SqlClient class.

Exception Management Application Block

This Application Block provides a framework for logging exception information and publishing to the event log, or you can create your own custom publisher.

Logging Application Block

This Application Block uses the Enterprise Instrumentation Framework (EIF) to assist in the development of instrumented applications.

Smart Client Offline Application Block

This Application Block provides an infrastructure to develop applications with offline capabilities.

Updater Application Block

This Application Block helps you recognize, validate, and download updated application files from a central location.

User Interface Process Application Block

This Application Block provides a series of components that assist the developer in creating UI process components.


One of the Reference Building Blocks that the Microsoft Practices & Patterns team has introduced is a data access helper framework called the Data Access Application Block for .NET. This data access helper framework provides a series of static methods for simplifying CRUD (Create, Read, Update, and Delete) operations. It contains two main classes: the SqlHelper class, and the SqlHelperParameterCache class. The SqlHelper class provides for simplified data access to a SQL server database and the SqlHelperParameterCache class caches SqlParameters for a given command as well as connection so that you can reuse them at any given time. Together these classes encapsulate the code you will need to perform most of your routine data access logic.

Page 1 of 4
advertisement
  Next Page: The SqlHelper Class
Page 1: IntroductionPage 3: SqlHelperParameterCache Class
Page 2: The SqlHelper ClassPage 4: Working with the Data Access Application Block
© Copyright Component Developer Magazine and EPS Software Corp., 2006
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES