using (DbConnection conn = new DbConnection()) { // do stuff with database }
Will the using block call conn.Close()?<
using
conn.Close()
Yes - http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.close.aspx
edit: from Microsoft: "The connection is automatically closed at the end of the using block."