Hi,
I need to import excel data to a datagridview, without using interop, because it only works when excel is installed in computer.
I searched and found out about OleDB, which kind of simmulates a database in order to get those values, however, i can't find a c++ code for that anywhere!
Can someone help me out with it? Or give me a way to go?
Yes, i'm using C++/CLI with Visual Studio C++ 2010. I know it's not recommended, but I can't change due to circunstances now.
Microsoft::Oficce::Interop::Excel is a way to get and write values from/to excel files, however it only works when excel is installed on the users computer, and I can't rely on that.
Like I said, i found out some stuff about OleDb and ADO, but none in C++ algorithm.. Or maybe another better, safer and easier way to do that...
If you're using C++/CLI then you can base your code on C# examples as it's easy enough to map from C# to C++/CLI. And there are usually many more .NET examples in C# than C++/CLI.
What you need to check out is OleDbDataReader using either the newer ACE provider or Jet provider.
This article provides a quick comparison between C++/CLI and C#. It’s meant for those who know C# (and possibly C++) and will explain which C++/CLI language construct correspond with which in C#. (I don’t know Visual Basic so I can’t add infos about this here.)