OLEDB异常"objConn.ServerVersion"引发了类型为"System.InvalidOperationException"的异常 [英] OLEDB Exception "objConn.ServerVersion' threw an exception of type 'System.InvalidOperationException'

查看:997
本文介绍了OLEDB异常"objConn.ServerVersion"引发了类型为"System.InvalidOperationException"的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我一直在尝试使用Oledb读取Excel文件,但是当我尝试打开连接时会引发以下异常:
"''objConn.ServerVersion'' threw an exception of type ''System.InvalidOperationException''"

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.

推荐答案

为什么在尝试打开连接时甚至还弄乱了ServerVersion?您根本不需要它.

如果您需要Excel的连接字符串,请尝试此处 [
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[^].


这篇关于OLEDB异常"objConn.ServerVersion"引发了类型为"System.InvalidOperationException"的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆