public override DbParameter AddParameter(DbCommand cmd, String name, String value, SqlParamterTypes type, int size, System.Data.ParameterDirection direction)
        {
            OracleParameter param   = new OracleParameter();
            OracleCommand   command = (OracleCommand)cmd;

            param.ParameterName = name;
            param.Direction     = direction;
            param.Value         = value;
            param.Size          = size;

            int enumValue = (int)type;

            if (enumValue >= 100)
            {
                param.OracleDbType = (OracleDbType)Enum.Parse(typeof(OracleDbType), type.ToString());
            }
            else
            {
                param.DbType = (System.Data.DbType)Enum.Parse(typeof(System.Data.DbType), type.ToString());
            }

            // For Oracle Functions, ReturnValue Must Be First Parameter
            if (param.Direction == System.Data.ParameterDirection.ReturnValue)
            {
                command.Parameters.Insert(0, param);
            }
            else
            {
                command.Parameters.Add(param);
            }
            return(param);
        }
Exemplo n.º 2
0
        public override DbParameter AddParameter(DbCommand cmd, String name, String value, SqlParamterTypes type, int size, System.Data.ParameterDirection direction)
        {
            SqlParameter param   = new SqlParameter();
            SqlCommand   command = (SqlCommand)cmd;

            param.ParameterName = name;
            param.Value         = value;
            param.Direction     = direction;
            param.Size          = size;

            param.DbType = (System.Data.DbType)Enum.Parse(typeof(System.Data.DbType), type.ToString());

            command.Parameters.Add(param);
            return(param);
        }