Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi frnds,

How to Insert Gridview checkbox selected values in database.
I have 3 columns in gridview and also with checkboxe in item template of Gridview.


I have a submit button outside gridview, when i click checkbox and click on submit button....selected row must insert into database.

CheckboxID is checkRow
Gridview Id is GVUsers

Please can you help me, how to insert checkbox selected values into database
Posted

you can do it by using foreach loop inside submit button click event.
for example :

C#
foreach (GridViewRow r in GVUsers.Rows)
     {

         CheckBox chk = (CheckBox)r.FindControl("checkRow");

         if (chk!=null && chk.Checked)
         {
             //Write your code to insert data of this row into data base..
         }
     }


Hope this will help you.
 
Share this answer
 
 
Share this answer
 

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