Beispiel #1
0
        public void Insert(Users obj)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@paperName", SqlDbType.NVarChar, 50),
                new SqlParameter("@paperType", SqlDbType.NVarChar, 30),

                new SqlParameter("@deptID",    SqlDbType.SmallInt, 2)
            };
            parameters[0].Value = obj.ID;
            parameters[1].Value = obj.Name;
            parameters[2].Value = obj.Password;
            DBHelperProcedure.Insert("UP_T_Paper_ADD", parameters);
        }
Beispiel #2
0
        public void InsertProc()
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@deptID",      SqlDbType.NVarChar, 50),
                new SqlParameter("@TestId",      SqlDbType.Int,       3),
                new SqlParameter("@deptName",    SqlDbType.NVarChar, 50),
                new SqlParameter("@reutrnValue", SqlDbType.Int, 4)
            };

            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Direction = ParameterDirection.Output;
            parameters[2].Value     = "李四";
            parameters[3].Direction = ParameterDirection.ReturnValue;
            DBHelperProcedure.Insert("UP_User_Name", parameters);
            int    s  = Convert.ToInt32(parameters[3].Value);
            string ss = parameters[0].Value.ToString();
            // int retValue = Convert.ToInt32(parameters["@RetValue"].Value.ToString());
        }