ANAY SHUKLA

ANAY SHUKLA

  • NA
  • 24
  • 453

Delete from Repeator

Jan 19 2018 12:22 AM
protected void rptlist_ItemCommand(object source, RepeaterCommandEventArgs e)
{
try
{
if (e.CommandName == "Del")
{
int paymentid = 0;
paymentid = Convert.ToInt32(((Label)rptlist.Items[0].FindControl("lblpaymentid")).Text);
SqlParameter[] Paramsdel = { new SqlParameter("@Mode","D"),
new SqlParameter("@paymentid",paymentid)
};
int Res = 0;
Res = JSQL.execStoredProcudure("sp_bank", Paramsdel);
if (Res > 0)
{
JRDMessage.UserMessage(this, "Data deleted Sucessfully ");
FillDetails();
bindDet();
}
}
}
catch (Exception ex)
{
}
}
 
This is my code i want to delete row from data using payment id but when ever i click on last row or middle row button for delete then it will deleted top row every time , how can i manage it. 

Answers (2)