Exemplo n.º 1
0
        public void Dispose(bool isDispose)
        {
            if (TransStats == 1)
            {
                RollbackTrans();
            }


            if (isDispose)
            {
                DbConn.Close();
                DbConn.Dispose();
                Command.Dispose();
                DbConn  = null;
                Command = null;
            }
            else
            {
                if (DbConn != null)
                {
                    DbConnPool[Key].ReleaseObject(DbConn);
                }
                if (Command != null)
                {
                    DbCommandPool.ReleaseObject(Command);
                }

                DbConn  = null;
                Command = null;
            }
        }
Exemplo n.º 2
0
        public NpgSqlExecuteXY()
        {
            DbConn = DbConnPool["DefautConnectionString"].GetObject();
            if (DbConn == null)
            {
                throw new Exception("Sql Connection obj is NULL,Please Look LogOut ERROR Msg!!");
            }

            Key                = "DefautConnectionString";
            Command            = DbCommandPool.GetObject();
            Command.Connection = DbConn;
        }
Exemplo n.º 3
0
        public NpgSqlExecuteXY(string key)
        {
            DbConn = DbConnPool[key].GetObject();

            Key = key;

            if (DbConn == null)
            {
                throw new Exception(
                          string.Format("Sql Connection obj is NULL,Please Look LogOut ERROR Msg!! FOR KEY:{0}", key));
            }

            Command            = DbCommandPool.GetObject();
            Command.Connection = DbConn;
        }