Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have been trying to read an Excel file using Oledb, but it throws the following exception when I try to open the connection:
"'objConn.ServerVersion' threw an exception of type 'System.InvalidOperationException'"

Any pointers on this will be appreciated.
Updated 18-Mar-11 2:58am

1 solution

Why are you even messing with ServerVersion when trying to open a connection? You don't need it at all.

If you need a connection string for Excel, try here[^].
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900