简体   繁体   中英

DAAB, do we need to handle connection opening closing manually?

I am using DAAB. Plz guide me do we need to check and clsoe connections manually after a db call ?

thanks

Enterprise library takes care of opening and closing connections for you.

You don't need to write code to do this.

A way of using Entlib 5.0 DAAB (without unity or any other dependency injection) is :

public DataSet someMethod()
{
    database = new SqlDatabase(connectionString);
    return database.ExecuteDataSet("procName", valparam1, valparam2);
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM