title: How to download excel file after exporting data from Dataset to Excel?
body: <p>Here i dont know how to download Excel File foramt after sending data from Data set to Excel file.
  this is my code pls help</p>
  
  <pre><code>public void exporttoexcel(DataTable dt)
  {   
      Excel.Application xlApp;
      Excel.Workbook xlWorkBook;
      Excel.Worksheet xlWorkSheet;
      object misValue = System.Reflection.Missing.Value;
      xlApp = new Excel.Application();
      xlWorkBook = xlApp.Workbooks.Add(misValue);
      xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
      for (int i = 1; i &lt; dt.Columns.Count + 1; i++)
      {
          xlWorkSheet.Cells[1, i] = dt.Columns[i - 1].ColumnName;
      }
  
      for (int j = 0; j &lt; dt.Rows.Count; j++)
      {
          for (int k = 0; k &lt; dt.Columns.Count; k++)
          {
              xlWorkSheet.Cells[j + 2, k + 1] = dt.Rows[j].ItemArray[k].ToString();
          }
      }
      xlWorkBook.Save();
      xlWorkBook.Close();
      xlApp.Quit();
  }
  </code></pre>