示例#1
0
        /// <summary>
        /// Creates a new DBParam with an constant value.
        /// NOTE: The parameter type cannot be determined if null or DBUnll is passed as the value
        /// </summary>
        /// <param name="paramValue"></param>
        /// <returns></returns>
        public static DBParam ParamWithValue(object paramValue)
        {
            DBParam pref = new DBParamRef();

            pref.Value = paramValue;
            return(pref);
        }
示例#2
0
        /// <summary>
        /// Creates a new DBParam with the DbType and constant value.
        /// </summary>
        /// <param name="type">The DbType of the parameter</param>
        /// <param name="paramValue">The value of the parameter</param>
        /// <returns></returns>
        public static DBParam ParamWithValue(System.Data.DbType type, object paramValue)
        {
            DBParam pref = new DBParamRef();

            pref.Value  = paramValue;
            pref.DbType = type;
            return(pref);
        }
示例#3
0
        //
        // static factory methods
        //

        #region public static DBParam Param(string name) + 3 overloads

        /// <summary>
        /// Creates a new DBParam clause with the specified generic name. Cannot support delegate methods as values
        /// </summary>
        /// <param name="genericName">The generic name of the parameter (e.g. param1 rather than @param1)</param>
        /// <returns></returns>
        public static DBParam Param(string genericName)
        {
            DBParam pref = new DBParamRef();

            pref.Name = genericName;

            return(pref);
        }
示例#4
0
        /// <summary>
        /// Creates a new DBParam with the specified name, type, and constant value
        /// </summary>
        /// <param name="genericName">The generic name of the parameter (e.g. param1 rather than @param1)</param>
        /// <param name="type">The type of the parameter</param>
        /// <param name="value">The value of the parameter</param>
        /// <returns></returns>
        public static DBParam ParamWithValue(string genericName, System.Data.DbType type, object value)
        {
            DBParam pref = new DBParamRef();

            pref.Name   = genericName;
            pref.DbType = type;
            pref.Value  = value;
            return(pref);
        }
示例#5
0
        /// <summary>
        /// Creates a new DBParam with the name and constant value.
        /// </summary>
        /// <param name="genericName">The generic name of the parameter (e.g. param1 rather than @param1)</param>
        /// <param name="value">The value of the parameter</param>
        /// <returns></returns>
        public static DBParam ParamWithValue(string genericName, object value)
        {
            DBParam pref = new DBParamRef();

            pref.Value = value;
            pref.Name  = genericName;

            return(pref);
        }
示例#6
0
        /// <summary>
        /// Creates a new DBParam with the specified name, DBType and direction. Cannot support delegate methods as values
        /// </summary>
        /// <param name="genericName">The generic name of the parameter (e.g. param1 rather than @param1)</param>
        /// <param name="type">The DbType of the parameter</param>
        /// <param name="direction">The parameters direction</param>
        /// <returns></returns>
        public static DBParam Param(string genericName, System.Data.DbType type, System.Data.ParameterDirection direction)
        {
            DBParam pref = new DBParamRef();

            pref.Name      = genericName;
            pref.DbType    = type;
            pref.Direction = direction;
            return(pref);
        }
示例#7
0
        /// <summary>
        /// Creates a new DBParam with the specified name, DBtype and size. Cannot support delegate methods as values
        /// </summary>
        /// <param name="genericName">The generic name of the parameter (e.g. param1 rather than @param1)</param>
        /// <param name="type">The type of the parameter</param>
        /// <param name="size">The (maximum) size of the parameter</param>
        /// <returns></returns>
        public static DBParam Param(string genericName, System.Data.DbType type, int size)
        {
            DBParam pref = new DBParamRef();

            pref.Name   = genericName;
            pref.DbType = type;
            pref.Size   = size;
            return(pref);
        }