Update 存储过程 失败,数据无法修改,
存储过程如下:
/*修改用户信息*/
CREATE PROCEDURE Ly_ModifyAdminInfo
(
@UserID int,
@UserPurview int,
@RealName varchar(50),
@UserTel varchar(50),
@UserMobile varchar(50),
@QQ varchar(50),
@MSN varchar(255),
@Email varchar(255),
@Purview_Other int,
@RestrNum int
)
AS
begin
Update Ly_Admin
Set UserPurview=@UserPurview,RealName=@RealName,UserTel=@UserTel,UserMobile=@UserMobile,QQ=@QQ,MSN=@MSN,Email=@Email,Purview_Other=@Purview_Other,RestrNum=@RestrNum
where (UserID=@UserID)
end
GO
程序中的部分代码:如果需要更多,可以补充,尝试了两种入库方式都失败,挺郁闷的
//SqlConnection conn = ConnDB.OpenConn();
//try
//{
// conn.Open();
// SqlCommand cmd = new SqlCommand( "Ly_ModifyAdminInfo ", conn);
// cmd.CommandType = CommandType.StoredProcedure;
// cmd.Parameters.Add( "@UserID ", SqlDbType.Int);
// cmd.Parameters[ "@UserID "].Value = Convert.ToInt32(UserID);
// cmd.Parameters.Add( "@UserPurview ", SqlDbType.Int);
// cmd.Parameters[ "@UserPurview "].Value = Convert.ToInt32(Request.Form[ "UserPurview "]);
// cmd.Parameters.Add( "@RealName ", SqlDbType.VarChar, 50);
// cmd.Parameters[ "@RealName "].Value = tbxRealName.Text.Trim();
//}
//catch(Exception)
//{
//}
//开始入库操作
SqlParameter[] paramters =
{
new SqlParameter( "@UserID ",SqlDbType.Int),//用户ID
new SqlParameter( "@UserPurview ",SqlDbType.Int),//用户主权限
new SqlParameter( "@RealName