Which One is Best OLEDB Or Excel Object Or Database

前端 未结 2 1957
醉梦人生
醉梦人生 2021-02-02 01:19

I need to work with Excel 2007 File for reading the data. for that which one is the best way to do that:

  1. Using OLEDB Provider
  2. Excel Interop Object
2条回答
  •  萌比男神i
    2021-02-02 02:05

    Options 1 and 2 are almost always an exercise in pain, no matter how you ask the question.

    If you can use SSIS to move the data into a database, and if that suits your needs because of other requirements, that's also a good option.

    But the preferred option is usually to use Office Open XML for Excel 2007 and later. That has none of the COM headaches you get with Option 2, and none of the issues you have with guessing row types as you have with Option 1.

    With a more carefully crafted question, you can get a far better answer, though.

提交回复
热议问题