c#获取存储过程的返回值
存储过程的返回值在C#中是怎么接收的。上代码
存储过程
CREATEPROCEDURE .
@ywdm varchar(10),
@value varchar(20) output
AS
begin
set @value=Select top 1 createt From table Where ywdm=@ywdm
end
获取返回值的方法:
var db = DatabaseFactory.CreateDatabase();
var cmd = db.GetStoredProcCommand("Proc_GetInfo");
db.AddInParameter(cmd, "ywdm", DbType.String, mYzm.Ywdm);
db.AddOutParameter(cmd, "@value", DbType.String, 20);
db.ExecuteNonQuery(cmd);
return cmd.Parameters["@value"].Value.ToString();
页:
[1]