コード例 #1
0
        public void Dispose()
        {
            if (Cmd != null)
            {
                Cmd.Parameters.Clear();
                Cmd.Dispose();
            }
            if (DS != null)
            {
                DS.Dispose();
            }

            if (Rdr != null)
            {
                Rdr.Close();
                Rdr.Dispose();
            }

            //if (Tran != null && Conn.State == ConnectionState.Open)
            //    Tran.Rollback();

            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
                Conn.Dispose();
            }
        }
コード例 #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                connectionString = "";
                ErrorDB          = "";

                DS.Dispose();
                DS_Send.Dispose();
                dsSender.Dispose();

                con_db.Dispose();
                conS.Dispose();

                da.Dispose();
                daSender.Dispose();

                cmd.Dispose();
                cmdSender.Dispose();
            }
        }