Dispose() method permanently removes connection object from memory and the resource no longer exists for any further processing.
string constring = "Server=(local);Database=my; User Id=sa; Password=sa";
SqlConnection sqlcon = new SqlConnection(constring);
sqlcon.Open(); // connection is open
// code here which will be execute
// code will be execute when error occurred in try block
sqlcon.Dispose(); // close and desroy the connection object