Jaya Prakash

Jaya Prakash

  • 543
  • 2.3k
  • 65.2k

Getting Same values when clicking on multiple rows of a column in Grid

May 3 2023 10:30 AM

this my button clcik i am getting the row index value in   7th line  

protected void lnkbtnView_Click(object sender, EventArgs e)
{
    try
    {
        LinkButton button = sender as LinkButton;
        DataTable dt = new DataTable();
        int rowindex = Convert.ToInt32(button.CommandArgument.ToString());
        dt = obank.GetMerchantBankDetails();
        lblBenId.Text = dt.Rows[0]["BeneficiaryID"].ToString();
        lblBenCode.Text = dt.Rows[0]["BeneficiaryCode"].ToString();
        lblBenName.Text = dt.Rows[0]["BeneficiaryName"].ToString();
        lblAccountNumber.Text = dt.Rows[0]["AccountNumber"].ToString();
        lblIFSC.Text = dt.Rows[0]["IFSC"].ToString();
        lblNameAsPerBank.Text = dt.Rows[0]["NameAsPerBank"].ToString();
        ScriptManager.RegisterStartupScript(UPDP_MerchantBanks, UPDP_MerchantBanks.GetType(), "ErrorMSg", "<script>ShowMainDialog();</script>", false);
    }
    catch (Exception Exception)
    {
        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "ErrorMSg", "<script>ShowErrorDialog('" + Exception.Message.ToString() + "')</script>", false);
    }
    catch (Exception ex)
    {

        oExceptionManager.LogError(ex.Message, " -- In  lnkView_Click Function in Users.aspx.cs");
    }
}

when i click 133 or 122 i am getting 100 values in my modal popup 

when i click on action suppose if i click on  2 row or 3 or 4 i am getting the values of 1st row only im not getting values which i need to display in modalpop for all the row click it is displaying only first row values 

my sp  how can i resolve this?? help me 

  
CREATE procedure usp_GetMerchantBankDetails      
as       
begin      
begin try   
select * from MerchantBanks     
end try  
begin catch  
select ERROR_MESSAGE()  
   INSERT INTO Application_Error_Log(ErrorMessage,FromPage,Createdon) VALUES(ERROR_MESSAGE(),'usp_InsertMerchantBanks',GETDATE())            
end catch  
end  

 


Answers (2)