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.
Unfortunately, activation email could not send to your email. Please try again.

Excel file to database

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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



resultat_a54f5db4.xls

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

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.

Regards,
Geetha

Shannon Broskie
Replied On February 5, 2015 04:25 PM

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 04:10 AM

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.

Regards,

Sudha R


CONFIRMATION

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.

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.

;