本文介绍了ServerVersion_'objcon.ServerVersion'抛出了类型'System.InvalidOperationException'_string {System.InvalidOperationException}的异常我执行OleDbConnection之后不久objcon = new OleDbConnection(" Provider = SQLOLEDB.1; Integrated Secur)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行该行后不久

OleDbConnection objcon = new OleDbConnection(" Provider = SQLOLEDB.1; Integrated Security = SSPI; Persist Security Info = False; Context Connection = true;初始目录= XXXXX;数据源= XXXXXX");

OleDbConnection objcon = new OleDbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Context Connection=true;Initial Catalog=XXXXX;Data Source=XXXXXX");

我能够使用向导从SQL服务器IDE连接任何数据源,但不能从代码连接。有线的事情是,我可以使用代码连接到我的本地数据库但不能连接到网络上的单个服务器,但是通过IDE或我能够连接的任何数据源
数据集向导。 

I am able to connect from SQL server IDE, any of the datasources using the wizards but not from the code. The wired thing is I can connect to my local database but not a single server on the network using the code, but through IDE or any of the datasource dataset wizards I am able to connect. 

推荐答案


这篇关于ServerVersion_'objcon.ServerVersion'抛出了类型'System.InvalidOperationException'_string {System.InvalidOperationException}的异常我执行OleDbConnection之后不久objcon = new OleDbConnection(" Provider = SQLOLEDB.1; Integrated Secur)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 10:57