We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel file to database

Thread ID:





88525 Jul 28,2009 04:11 PM UTC Feb 11,2015 09:10 AM UTC ASP.NET Web Forms (Classic) 3
Tags: XlsIO
Kjell Ek
Asked On July 28, 2009 04:11 PM UTC

How do I import an Excel file (resultat.xls) to a sql 2008 database? Is there a excempel available?


Geetha M [Syncfusion]
Replied On July 29, 2009 11:18 AM UTC

Hi Kjell,

It is not directly possible to export an XLS file to a SQL database. You can convert the file into a DataTable / DataView and then manually export it.

You can refer to the sample in the location given below that explains exporting of XLS file to a DataTable.
My Documents\Syncfusion\EssentialStudio\x.x.x.xx\Windows\XlsIO.Windows\Samples\2.0\Data Binding\Import-Export DataTable\

Please let me know if you have any questions.


Shannon Broskie
Replied On February 5, 2015 09:25 PM UTC

Can't the workbook be saved as a memory stream and then converted to a byte array for saving to the DB?

Sudha Ramachandran [Syncfusion]
Replied On February 11, 2015 09:10 AM UTC

Hi Shannon,


Yes, the workbook be saved as a memory stream as represented in the below code snippet. This memory stream can then be converted to a byte array for saving to the DB.


Code Snippet:


//Create new memory stream

MemoryStream stream = new MemoryStream();

//Save the excel workbook as stream

workbook.SaveAs(stream, ExcelSaveType.SaveAsXLS);


UG Documentation Link: http://help.syncfusion.com/ug/asp.net/default.htm#!documents/saveworkbookasastrea.htm


Please let us know if you have any queries.


Sudha R


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon