[C#]分享一个以前的项目使用的DataBaseAccess类(12)

/// <summary>
        ///Close DataBase Connection.
        /// </summary>
        public void CloseDB()
        {
            if (this.conn != null)
            {
                if (this.conn.State != ConnectionState.Closed)
                    this.conn.Close();
            }
        }
       
        /// <summary>
        /// Dispose Resource
        /// </summary>
        public void Dispose()
        {
            if (this.conn != null)
            {
                if (this.conn.State != ConnectionState.Closed)
                    this.conn.Close();
                this.conn.Dispose();
            }
        }
        #endregion
    }

#endregion

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyjwyj.html