text: ---
  uid: web-forms/videos/how-do-i/how-do-i-export-data-to-a-comma-delimited-csv-file-for-an-application-like-excel
  title: "[How Do I:] Export Data to a Comma Delimited (CSV) File for an Application Like Excel | Microsoft Docs"
  author: rick-anderson
  description: "In this video Chris Pels shows how to take data from a database or other source and export it to a comma delimited file that can be used in an application li..."
  ms.author: riande
  ms.date: 01/22/2009
  ms.assetid: c9df86ad-aec2-43d5-bb8a-413ebb666673
  msc.legacyurl: /web-forms/videos/how-do-i/how-do-i-export-data-to-a-comma-delimited-csv-file-for-an-application-like-excel
  msc.type: video
  ---
  # [How Do I:] Export Data to a Comma Delimited (CSV) File for an Application Like Excel
  
  by [Chris Pels](https://twitter.com/chrispels)
  
  In this video Chris Pels shows how to take data from a database or other source and export it to a comma delimited file that can be used in an application like Excel. First, a set of data is created as a DataTable object. Next, the Response for the current web page request is cleared and the header and content type are configured to be a csv file. Then the actual data is added to the response stream by first writing the column headers for the csv file followed by the data values. This approach can be useful when users require an export of data so it can be manipulated locally in a program like Excel.
  
  [&#9654; Watch video (19 minutes)](https://channel9.msdn.com/Blogs/ASP-NET-Site-Videos/how-do-i-export-data-to-a-comma-delimited-csv-file-for-an-application-like-excel)
  