try
{
var sValue = "0";
var db = DatabaseFactory.CreateDatabase();
var cmd = db.GetStoredProcCommand("proc_GetYzmInfo");
db.AddInParameter(cmd, "phone", DbType.String, mYzm.Phone);
db.AddParameter(cmd, "@Result", DbType.String, ParameterDirection.ReturnValue, "", DataRowVersion.Current, null);
//db.AddOutParameter(cmd, "@value", DbType.String, 20);
db.ExecuteDataSet(cmd);
return cmd.Parameters["@Result"].Value.ToString();
}
catch (Exception e)
{
Log.Error("获取验证码发送记录出错 -> " + e);
return null;
}
注意这里面分两种类型,ParameterDirection.ReturnValue为返回Return类型,db.AddOutParameter为返回Output类型