如何在webmatrix表单中编写更新存储过程?

时间:2013-01-01 13:16:17

标签: c# asp.net webmatrix

在这里,我在我的webmatrix表单中编写了更新查询,该表单运行正常,但我想使用存储过程代替查询,那么我该怎么写呢?

var UpdateQuery = "UPDATE Reg_tb SET FirstName = @0, LastName = @1, UserName = @2, Password  = @3 WHERE UID = @4";
db.Execute(UpdateQuery, FirstName, LastName, UserName, Password, Userid);

1 个答案:

答案 0 :(得分:0)

也许这个?

var execProc="EXEC ProcName FirstName=@0,LastName=@1,UserName=@2,Password=@3, UID=@4";
  db.Execute(execProc,FirstName,LastName,UserName,Password,Userid);