Data Access


The Data Access Application Block has been simplified to provide better integration with ADO.NET 2.0. The tighter integration with ADO.NET 2.0 results in several benefits.

  • The block uses the ADO.NET <connectionStrings> configuration section to house the configuration data for a connection string. This allows connection strings to be shared between the application block and other .NET classes that use this section. However, configuration information that is not supported by the <connectionStrings> section, like the name of the default database provider and information for all the database providers that are available to an application, still reside in the <dataConfiguration> section.

  • DbCommandWrappers are no longer needed to wrap around the DbCommand exposed by a .NET managed data provider. With the latest release of the Data Access Application Block, the block uses the ADO.NET DbCommand instead of a DBCommandWrapper.

  • The Data Access Application Block can be used with any ADO.NET 2.0 managed provider by using the GenericDatabase class. There is no need to use an Enterprise Library database provider that has been designed specifically for a particular database type. The database providers are still beneficial, though, as they provide increased functionality, like parameter discovery and transparency between different database implementations.

This version of the Data Access Application Block also makes it easier to use connection strings that are dynamically created instead of read from configuration. This was one of the most common requests in Enterprise Library for the .NET Framework 1.1, and while it is possible to accomplish this, it is not very straightforward. With the latest release, you can create a connection string programmatically and use it directly to create an instance of a database provider.




Fenster Effective Use of Microsoft Enterprise Library(c) Building Blocks for Creating Enterprise Applications and Services 2006
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services
ISBN: 0321334213
EAN: 2147483647
Year: 2004
Pages: 103
Authors: Len Fenster

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net