public void Dispose()
 {
     SelectCommand.Dispose();
     UpdateCommand.Dispose();
     InsertCommand.Dispose();
     DeleteCommand.Dispose();
 }
예제 #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;
            }
        }
예제 #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);
            }
        }