user9311551
user9311551

Reputation: 1

How to import data from Excel to C# Service based database?

Im using C# and Service based database and I need to import some data from Excel to my database ..How could I possibly do this?? Please help. Thanks a lot.

Upvotes: 0

Views: 455

Answers (2)

Terry Carmen
Terry Carmen

Reputation: 3886

You can open the excel file with the Excel database driver and read it like any other data source, however this means you need the driver, which isn't installed by default.

Download

HowTo

However if the sheet only contains data and doesn't need any calculations, you can unzip the XLSX file, and find sheet1.xml (or whatever it's called in your file), open it in your app like any other XML file and import the data.

This is likely to be a much better long term solution, since MS has been trying to kill off the Access database driver for ages.

Also, it's been a while, but I don't believe MS recommends using the MSDE from within a service.

Upvotes: 1

Related Questions