コード例 #1
0
        public static TParamVal CreateParameter(string sname, object oVal, ParameterDirection pdir = ParameterDirection.Input)
        {
            var p = new TParamVal
            {
                name = sname,
                val  = oVal,
                dir  = pdir
            };

            return(p);
        }
コード例 #2
0
        private static void AddSPParam(IDbCommand cmd, TParamVal item)
        {
            // Create the parameter
            var p = cmd.CreateParameter();

            p.ParameterName = string.Format("{0}{1}", ParamPrefix, item.name);
            p.Value         = item.val;
            p.Direction     = item.dir;

            // Add to the collection
            cmd.Parameters.Add(p);
        }