Exemplo n.º 1
0
        /// <summary>
        /// 創建一個實例對象
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static CmdParameter NewInstance(string name, object value, DbType type)
        {
            CmdParameter rtn = new CmdParameter();

            rtn.ParameterName  = name;
            rtn.ParameterValue = value;
            rtn.DataType       = type;

            return(rtn);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 創建一個實例對象
        /// </summary>
        /// <param name="name">參數名稱</param>
        /// <param name="value">參數值</param>
        /// <param name="direction">參數指向</param>
        /// <returns></returns>
        public static CmdParameter NewInstance(string name, object value, ParameterDirection direction)
        {
            CmdParameter rtn = new CmdParameter();

            rtn.ParameterName  = name;
            rtn.ParameterValue = value;
            rtn.Direction      = direction;

            return(rtn);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 創建一個實例對象
        /// </summary>
        /// <param name="name">參數名称</param>
        /// <param name="value">參數值</param>
        /// <param name="datatype">參數類型,如果參數为返回值類型则必须指定</param>
        /// <param name="length">參數长度,如果參數为返回值類型则必须指定</param>
        /// <returns></returns>
        public static CmdParameter NewInstance(string name, object value, DbType datatype, int length)
        {
            CmdParameter rtn = new CmdParameter();

            rtn.ParameterName  = name;
            rtn.ParameterValue = value;
            rtn.DataType       = datatype;
            rtn.DataLength     = length;

            return(rtn);
        }