我想在Payments
表更新一行,並獲得該行從表中返回列從SQL Server更新表時
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
//
}
的幾個列值在上面我所說的DAL類的DoCommand
功能
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
請提供屏幕截圖的確切錯誤。別人很容易理解你的問題。 –
不,我沒有錯誤,我想要更新函數中的p_amount和p_amount和p_amount的值 –
@Mohammadhossein請注意您的複製粘貼。你已經粘貼了3次p_amount。 –