The ASP.NET web page structure examples for the database assistant do not include Close or Dispose calls, since the framework itself is designed to call Dispose for you at the end of the query. If you use ADO.NET instead of the database helper, you must use the instructions. Having said that, you have nothing to stop wrapping database calls with blocks:
IEnumerable<dynamic> floaters = null; using(var db = Database.Open("MyDb")){ var sql = "SELECT * From LifeRafts"; floaters = db.Query(sql); }
If you want to manage all of this, you can simply call Close or Dispose. Both of them cause the connection to still return to the ADO.NET connection pool.
source share