Dispose()销毁对象,垃圾回收机制。using(SqlConnection conn = new SqlConnection(ConnStr)){ 这样写会自动垃圾回收。}
用using语句最好了。
Using(SqlConnection conn = new SqlConnection(ConnStr)){ 封装了释放资源的方法}