ServerVersion_'objcon.ServerVersion'抛出了类型'System.InvalidOperationException'_string {System.InvalidOperationException}的异常我执行OleDbConnection之后不久objcon = new OleDbConnection(" Provider = SQLOLEDB.1; Integrated Secur) [英] ServerVersion_'objcon.ServerVersion' threw an exception of type 'System.InvalidOperationException'_string {System.InvalidOperationException} Soon after I execute the line 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.
推荐答案
你在谈论什么网络?并且是否在此网络上的计算机上运行的MS SQL Server甚至配置为允许远程连接到它?
What network are you talking about? And is MS SQL Server running on a machine on this network even configured to allow remote connections to it?
这篇关于ServerVersion_'objcon.ServerVersion'抛出了类型'System.InvalidOperationException'_string {System.InvalidOperationException}的异常我执行OleDbConnection之后不久objcon = new OleDbConnection(" Provider = SQLOLEDB.1; Integrated Secur)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!