title: how can i loop through a grid to pick up specific rows in asp?
body: <p>I have a gridview in an asp web form and I want to loop through it in order to pick up only when the gender column is M and feed that row into a table?
  My gridview code is bellow, thanks for any help.</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CourseCode,ClientNumber" DataSourceID="SqlDataSource1" Height="237px" Width="801px"&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="CourseCode" HeaderText="CourseCode" ReadOnly="True" SortExpression="CourseCode" /&gt;
              &lt;asp:BoundField DataField="ClientNumber" HeaderText="ClientNumber" ReadOnly="True" SortExpression="ClientNumber" /&gt;
              &lt;asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" /&gt;
              &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;
              &lt;asp:BoundField DataField="Surname" HeaderText="Surname" SortExpression="Surname" /&gt;
              &lt;asp:BoundField DataField="Forename" HeaderText="Forename" SortExpression="Forename" /&gt;
              &lt;asp:BoundField DataField="Gender" HeaderText="Gender" SortExpression="Gender" /&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>