public static int ExecuteNonQueryTransaction(string cmdText, CommandType cmdType, IDbDataParameter[] cmdParms, DistributedTransaction DTrans)
        {
            int val = 0;

            // Create Instance of Command object via data access factory
            IDbCommand cmd = DataAccessFactory.CreateCommand(cmdText, DTrans.Connection());

            cmd.CommandType = cmdType;
            if (cmdParms != null)
            {
                foreach (IDbDataParameter param in cmdParms)
                {
                    cmd.Parameters.Add(param);
                }
            }

            try
            {
                val = cmd.ExecuteNonQuery();
                OracleConnection Orconn = new OracleConnection();
                if (DTrans.Connection().GetType() == Orconn.GetType())
                {
                    OracleParameter oracleoutParam = (OracleParameter)cmd.Parameters["errmsg"];
                    if (oracleoutParam != null)
                    {
                        oracleoutParam.Direction = ParameterDirection.Input;
                        val = Int32.Parse(oracleoutParam.Value.ToString());
                    }
                }
                cmd.Parameters.Clear();
            }
            catch
            {
                DTrans.HAPPY = false;
            }

            //Modified By: Adam Alinauskas
            //Date Modified: June 30, 2004
            //Description: changed the return value to return the identity that was just used.
            //cmdText = "SELECT @@IDENTITY";
            //cmd = DataAccessFactory.CreateCommand(cmdText, conn);
            //string ID = cmd.ExecuteScalar().ToString();

            //if (ID != null && !ID.Equals(""))
            //{
            //    val = Convert.ToInt32(cmd.ExecuteScalar().ToString());
            //}

            return(val);
        }
        /// Execute Reader in Transaction
        ///
        public static IDataReader ExecuteReader(string cmdText, CommandType cmdType, IDbDataParameter[] cmdParms, DistributedTransaction DT)
        {
            // Create Instance of Connection object via data access factory

            // Create Instance of Command object via data access factory
            IDbCommand cmd = DataAccessFactory.CreateCommand(cmdText, DT.Connection());

            cmd.CommandType    = cmdType;
            cmd.CommandTimeout = 1800000;
            if (cmdParms != null)
            {
                foreach (IDbDataParameter param in cmdParms)
                {
                    cmd.Parameters.Add(param);
                }
            }
            // we use a try/catch here because if the method throws an exception we want to
            // close the connection throw code, because no datareader will exist, hence the
            // commandBehaviour.CloseConnection will not work
            try
            {
                IDataReader reader = cmd.ExecuteReader();
                cmd.Parameters.Clear();
                return(reader);
            }
            catch
            {
                cmd.Connection.Close();
                DT.HAPPY = false;
                return(null);
            }
        }