title: Get column names from my dataset
body: <p>My code here loops through a Customer and exports the result into a Excel document with multiple sheets, all depending on how many services/reports this customer has. 
  What I want is to only get the column names and print them out into a gridview. 
  Here is my full code where I run the customer and export everything to a excel file (which works fine).
  I seem totally lost here and I really do need some help.</p>
  
  <pre><code>  var custName = Convert.ToString(Request.QueryString["cusName"]);
          try
          {             
              DataSet dt = new DataSet();             
              SqlConnection connection = new SqlConnection("Data Source=AP;Initial Catalog=DB_inf;User Id=sa;Password=*****;App=EntityFramework");
              using (SqlCommand sqlCmd = new SqlCommand("info.dbo.SP_Accounting_GetAll_Services", connection))
              {
                  sqlCmd.CommandType = CommandType.StoredProcedure;
                  sqlCmd.Parameters.AddWithValue("@customerName", SqlDbType.NVarChar).Value = custName;
                  using (SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd))
                  {
                      Session["TaskTable"] = dt;
                      sqlDa.Fill(dt);
                      if (dt.Tables.Count &gt; 0)
                      {
                          MemoryStream ms = new MemoryStream();
                          int i = 1;
                          using (ExcelPackage package = new ExcelPackage(ms))
                          {
                              string filename = Server.MapPath("") + @"\Accounting_Templates\" + custName + ".xlsx";
                              FileInfo inputfile = new FileInfo(filename);
                              ExcelPackage summaryTemplate = new ExcelPackage(inputfile);
                              foreach (ExcelWorksheet sheet in summaryTemplate.Workbook.Worksheets)
                              {
                                  package.Workbook.Worksheets.Add(sheet.Name, sheet);
                              }
  
                              foreach (DataTable table in dt.Tables)
                              {
                                  var columns = new List&lt;string&gt;();
  
  
                                  ExcelWorksheet worksheet = package.Workbook.Worksheets.ToList().Where(z =&gt; z.Name == string.Format("Report{0}", i)).FirstOrDefault();
                                  if (worksheet != null)
                                  {
                                      worksheet.Cells["A1"].LoadFromDataTable(table, true);
                                      worksheet.Cells.AutoFitColumns();
                                  }
                                  i++;
                              }
                              Response.Clear();
                              package.SaveAs(Response.OutputStream);
                              Response.AddHeader("content-disposition", "attachchment; filename=" + custName + ".xls");
                              Response.Charset = "";
                              Response.ContentType = "application/vnd.xls";
                              Response.End();
                          }
                     }
                  }
              }
          }
          catch (Exception)
          {
              Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('Something wen't wrong');", true);
          }
  </code></pre>