2014-12-12 3 views

답변

2

블록을 사용하면 IDisposable을 구현하는 개체를 사용할 때만 유용합니다. (5 번 빨리 말하십시오.) 이러한 객체의 dispose 메소드가 범위를 벗어난 후에 호출되도록합니다.

using(SqlConnection con = new SqlConnection(this.connString)) 
{ 
    //do stuff here 
} //con.Dispose() will be called for you automatically. 
+0

답장 @Matt for the answer – Deepak