I Get An "Error: Cannot Initialize OLE" When I Try To Connect To A Database? C#
I'm trying to connect to a database via C#, but I'm getting a very unhelpful error message when I do so: '08:44:17: Error: Cannot initialize OLE 08:44:17: Error: Cannot initialize
Solution 1:
For anyone who might be looking, I eventually solved this by adding a [STAThread()] before the Main() method. :)
Solution 2:
I suspect that you are building the project for x64 CPU. There is no OLE driver for x64. I recommend to change the build target from ANY CPU to x86.
Post a Comment for "I Get An "Error: Cannot Initialize OLE" When I Try To Connect To A Database? C#"