Possible Duplicate:
Looping through DataGrid rows and Checking Checkbox Control
I currently have a GridView which displays data from a Student Table, there is two template fields in the gridview: Checkbox and Label (the label template field displays the StudentID). I have a button on the page which when the user clicks the button I need to loop through each row in the GridView, then find the CheckBox then I need to check if the checkbox is checked or not. If the checkbox is checked I need to add the value in the Label Template Field to a different table in the database. How do I go about acheiving this? I am using C# Code.