title: How do I read an excel file in c# skipping the column headers?
body: <p>I am using SmartXLSX to read excel files successfully, but I'm facing a problem. My program is reading the column header's as a new row along with all the other rows from the spreadsheet. How should I update my program to skip the column header's and read the other rows.</p>
  
  <pre><code> private void GetCompanies()
          {
              int count = 0;
  
              Companies = new List&lt;Company&gt;();
  
              string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
              string path = Path.Combine(directory, "Toll-Companies.xlsx");
  
  
              SmartXLS.WorkBook WB = new WorkBook();
              WB.readXLSX(path);
  
              DataTable dt = WB.ExportDataTable();
  
  
  
                  string CurrentType = string.Empty;
                  string CurrentCategory = string.Empty;
                  string Removerow = string.Empty;
  
                  string b,c;
                  //DataRow rowe = dt.Rows[0];
                  //dt.Rows.Remove(rowe);
                  //loop through each row
  
                  foreach (DataRow dr in dt.Rows)
                     {
  
  
                      //Get company name in column c from Excel
                      c = dr[2].ToString();
  
                      //Get value in column B from Excel
                      b = dr[0].ToString();
  
  
                      if (b.StartsWith("Type:"))
                      {
                          CurrentType = b.Substring(6).Trim();
                      }
  
                      if (b.StartsWith("Primary Specialty"))
                      {
                          CurrentCategory = b.Substring(20).Trim();
                      }
  
                      //if company name is empy then skip row
                      if (string.IsNullOrEmpty(c)) continue;
  
                      //string Type = dr[7].ToString();
                      //dt.Columns.Add(Type)
  
                      //string cmp_type = dr[0].ToString();
                      //if (string.IsNullOrEmpty(cmp_type) || cmp_type == "Type") continue;
  
  
                      var cmp = new Company();
  
  
                      cmp.company_type = CurrentType;
                      cmp.company_category = CurrentCategory;
                      cmp.name = dr[2].ToString();
                      Companies.Add(cmp);
                      count++;
  }
  </code></pre>