title: Iterate datarow in c#
body: <p>In Selected dataRow I have totally 200 data record rows. Now I need to divide the 200 records into 20  [10 times(for loop)]. so I use the take(20).It will take first 20 records.</p>
  
  <p>I need to remove the first 20 records in last and need to choose another 20 records.I need to execute the 10 times for loop and get all the 200 records.</p>
  
  <pre><code>DataRow[] selectedDataRow = dtSMSDetails.Select("description = '" + smsDescription + "'");
  
  if (selectedDataRow.Length &gt; 0)
  {
      string smsRecordId = "";
      string mobileNum = "";
      string smsSubject = "";
  
      foreach (DataRow rows in selectedDataRow.Take(20)) 
      {
          smsRecordId += rows["activityid"].ToString() + ",";
          smsSubject = rows["subject"].ToString();
          mobileNum += rows["telephone1"].ToString() + ",";
          // Here I need to remove the first 20 (take 20) records from the selected data row and need to loop next 20 records. 
      }
  }
  </code></pre>