我想更新Payments
表中的一行并获取该行的几个列值
public void update(Int64 id , int status)
{
dal.DoCommand("Payments_Update", new SqlParameter("@Id", id), new SqlParameter("@Status", status));
// I WANT GET p_amount , p_credit ,p_debtor OF tbl_Payments HERE
//
}
在上面我调用DoCommand
了 DAL 类的函数
public void DoCommand(string sqlCmd, params SqlParameter[] parms)
{
command.CommandText = sqlCmd;
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Clear();
command.Parameters.AddRange(parms);
command.ExecuteScalar();
}
这是Payments_update
程序
alter procedure dbo.Payments_Update
(@Id bigint,
@Status int)
as
update tbl_Payments
set p_status = @Status
where p_id = @Id
return
这些是我payments
表的列
p_amount int, p_creditor int, p_debtor int