天天看點

WebMatrix Database.Open… Close() and Dispose()

asp.net web pages framework examples of the database helper do not include

calls to close or dispose because the framework itself is designed to call

dispose for you at the end of a request. if you use ado.net instead of the

database helper, you should employ using statements. having said that, there is

nothing to stop you from wrapping database helper calls in using blocks:

if you wanted to manage it all yourself, you can simply call close or

dispose. they both result in the connection being returned to the ado.net

connection pool anyway.