C# .NET - how to write sql server table data to excel

Asked By sunil p on 29-Nov-12 04:28 PM
hi,

I want to write the sql server table to excel and want to send the created excel sheet to users  using outlook email(company email).I need to create excel sheets in one folder using the current date as the file name.
I want to run this automatically by every day. I need to finish this task using c#.net.
Please anybody can give me the best solution.I dont have any exp in windows services.

Thanks,
Sunil.
Keating Megan replied to sunil p on 02-Dec-12 11:07 PM
Here is a data export project that can export sql server table to Excel, you can see the source code here:

http://exportdata.codeplex.com/
http://www.codeproject.com/Articles/164582/8-Solutions-to-Export-Data-to-Excel-for-ASP-NET