Hi All
i need code that will help me export data from my sql server database into an excel spreadsheet .
Thanx
Hi All
i need code that will help me export data from my sql server database into an excel spreadsheet .
Thanx
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Feb 12, 2013, 3:42 AM
http://www.c-sharpcorner.com/uploadfile/eb5fab/export-large-data-from-gridview-to-excel-file-using-C-Sharp/default.aspx
PeroPosted Aug 31, 2010, 4:07 AM
you can easily, with just one method call, export DataTable to Excel with this Excel .NET library.
Here is a sample Excel C# code how to export DataSet to Excel:
// Create new ExcelFile.
var ef = new ExcelFile();
// Imports all the tables from DataSet to new file.
foreach (DataTable dataTable in dataSet.Tables)
{
// Add new worksheet to the file.
var ws = ef.Worksheets.Add(dataTable.TableName);
// Insert the data from DataTable to the worksheet starting at cell "A1".
ws.InsertDataTable(dataTable, "A1", true);
}
// Save the file to XLS format.
ef.SaveXls("DataSet.xls");
Zimbini WalazaPosted Aug 30, 2008, 5:27 AM
Gaurav TomarPosted Aug 29, 2008, 8:06 AM
Take a look on the given below link
http://www.dotnetheaven.com/UploadFile/rahul4_saxena/DataInExcelSheet05302007080823AM/DataInExcelSheet.aspx
If there is any problem than, let me know!!