public void Dispose()
 {
     SelectCommand.Dispose();
     UpdateCommand.Dispose();
     InsertCommand.Dispose();
     DeleteCommand.Dispose();
 }
Ejemplo n.º 2
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Cleans up resources (native and managed) associated with the current instance.
        /// </summary>
        /// <param name="disposing">
        /// Zero when being disposed via garbage collection; otherwise, non-zero.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (!disposed)
                {
                    if (disposing)
                    {
                        ////////////////////////////////////
                        // dispose managed resources here...
                        ////////////////////////////////////

                        if (disposeSelect && (SelectCommand != null))
                        {
                            SelectCommand.Dispose();
                            SelectCommand = null;
                        }

                        if (InsertCommand != null)
                        {
                            InsertCommand.Dispose();
                            InsertCommand = null;
                        }

                        if (UpdateCommand != null)
                        {
                            UpdateCommand.Dispose();
                            UpdateCommand = null;
                        }

                        if (DeleteCommand != null)
                        {
                            DeleteCommand.Dispose();
                            DeleteCommand = null;
                        }
                    }

                    //////////////////////////////////////
                    // release unmanaged resources here...
                    //////////////////////////////////////
                }
            }
            finally
            {
                base.Dispose(disposing);

                //
                // NOTE: Everything should be fully disposed at this point.
                //
                disposed = true;
            }
        }
Ejemplo n.º 3
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        protected override void Dispose(bool disposing)
        {
            try
            {
                if (!disposed)
                {
                    if (disposing)
                    {
                        ////////////////////////////////////
                        // dispose managed resources here...
                        ////////////////////////////////////

                        if (SelectCommand != null)
                        {
                            SelectCommand.Dispose();
                            SelectCommand = null;
                        }

                        if (InsertCommand != null)
                        {
                            InsertCommand.Dispose();
                            InsertCommand = null;
                        }

                        if (UpdateCommand != null)
                        {
                            UpdateCommand.Dispose();
                            UpdateCommand = null;
                        }

                        if (DeleteCommand != null)
                        {
                            DeleteCommand.Dispose();
                            DeleteCommand = null;
                        }
                    }

                    //////////////////////////////////////
                    // release unmanaged resources here...
                    //////////////////////////////////////

                    disposed = true;
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }