title: C# Multithreading Loop Datatable
body: <p>I have a <code>datatable</code> with <code>1000 records</code>. Each row has a column with a link.I will loop the <code>datatable</code> and fetch record from the website using the link in the <code>datatable</code>. The code is working fine , but this is taking too much time to retrieve the records. So I need to pass it in multiple threads and fetch records and add all the records to a single <code>datatable</code>. I an using <code>C# , Visual studio 2015</code>.</p>
  
  <p>How can we do using <code>threading C#</code>, Any help  appreciated.</p>
  
  <p>Existing code is as below.</p>
  
  <pre><code> for (int i = 0; i &lt; dt.Rows.Count; i++)
              {
                  String years = String.Empty;
  
  
                  dt.Rows[i]["Details"] = GetWebText(dt.Rows[i]["link"].ToString());
  
              }
  
  
  
      private String GetWebText(String url)
          {
              var html = new HtmlAgilityPack.HtmlDocument();
            string text= html.LoadHtml(new WebClient().DownloadString(url));
  
  return text;
          }
  </code></pre>