The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development cross-cutting concerns (such as logging, validation, data access, exception handling, and many others). Application blocks are a type of guidance; they are provided as source code, test cases, and documentation that can be used "as is," extended, or modified by developers to use on complex, enterprise-level line-of-business development projects.
While using enterprise library you have to concern about opening and closing connections.
This will automatically handle connection pooling and other important errors of connection and database.
I had used Enterprise Library 2.0 - January 2006.
To use Enterprise Library you required to add reference of following files:-
public class spt_monitor
public DataTable Read()
Database db = DatabaseFactory.CreateDatabase("masterConnection");
DbCommand dbCommand = db.GetSqlStringCommand("Select * from spt_monitor");
DataSet dataSet = db.ExecuteDataSet(dbCommand);
}This code is simply loading a dataset without much code.
Download Enterprise Library from following links:-
- Enterprise Library 4.1 - October 2008
- Enterprise Library 4.0 - May 2008
- Enterprise Library 3.1 - May 2007
- Enterprise Library 2.0 - January 2006
You can also download code running code which is using master database as example.
Goals for Enterprise Library
Enterprise Library is a collection of application blocks intended for use by developers who build complex, enterprise-level applications.
Enterprise Library is used when building applications that are typically to be deployed widely and to interoperate with other applications and systems. In addition, they generally have strict security, reliability, and performance requirements.
The goals of Enterprise Library are the following:
- Consistency. All Enterprise Library application blocks feature consistent design patterns and implementation approaches.
- Extensibility. All application blocks include defined extensibility points that allow developers to customize the behavior of the application blocks by adding their own code.
- Ease of use. Enterprise Library offers numerous usability improvements, including a graphical configuration tool, a simpler installation procedure, and clearer and more complete documentation and samples.
- Integration. Enterprise Library application blocks are designed to work well together or individually.