Click here to Skip to main content
15,997,960 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I want to get selected rows one database to grid I need to know , how to do can u guide me or snippets
I have tried to delete but I want to insert another table
C#
protected void btnDelete_Click(object sender, EventArgs e)
{
    //Loop through all the rows in gridview
    foreach(GridViewRow gvrow in gvUserDetails.Rows)
    {
        //Finiding checkbox control in gridview for particular row
        CheckBox chkdelete = (CheckBox)gvrow.FindControl("chkdelete");
        //Condition to check checkbox selected or not
        if(chkdelete.Checked)
        {
            //Getting UserId of particular row using datakey value
            int usrid = Convert.ToInt32(gvUserDetails.DataKeys[gvrow.RowIndex].Value);
            objUsers.DeleteParameters["UserId"].DefaultValue = usrid.ToString();
            objUsers.Delete();
        }
    }
}

here what can I do to insert another table data must be clone

[edit]Pre tag for C# code introduced, Treat my content ... as HTML unchecked. Capitalization and spelling corrected - PES[/edit]
Posted
Updated 23-Feb-12 18:38pm
v2
Comments
ythisbug 24-Feb-12 0:09am    
hi suhelsa..can u explain properly that we can understand ur problem?

1 solution

If It is my understanding that you want to save the deleted value in to another table
Then in the Store procedure you can handle it .. while deleting the record from the original table .. then 1st insert to the new table then delete from the Original table
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900