在 Open() 期间,SqlConnection.ServerVersion 抛出 System.InvalidOperationException

发布于 2024-08-18 13:25:05 字数 304 浏览 2 评论 0原文

当运行网络服务时,网页知道如何响应。该服务连接到数据库。在 sqlconnection.open 调用期间,ASP .NET 代码抛出以下异常:

sqlConnection.ServerVersion' 抛出类型为 'System.InvalidOperationException' 的异常

注意:我在我的开发计算机上运行此异常。当它在实时网络服务器上运行时,一切都很好。它对于我的系统来说是独一无二的。

我是否缺少 Sql Server 2008 的配置设置?

注意:最近从 Sql Server 2005 升级到 2008

When running a webservice, web page that knows how to respond. The service connects to a dbase. During the sqlconnection.open call, ASP .NET code throws the following exception:

sqlConnection.ServerVersion' threw an exception of type 'System.InvalidOperationException'

NOTE: I'm running this on my dev machine. When it runs on live web server, all is well. It is unique to my system.

I'm I missing a configuration setting with Sql Server 2008?

NOTE: recently upgraded from Sql Server 2005 to 2008

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

灰色世界里的红玫瑰 2024-08-25 13:25:05

这可能是由于实时服务器和开发计算机之间的 web.config 存在差异造成的。您是否检查过连接字符串是否正确指定?

This could possibly be caused by a difference in your web.config between the live server and your dev machine. Have you checked that the connection string is properly specified?

围归者 2024-08-25 13:25:05

发现问题了。连接字符串前面有一个空格。

Found problem. There was a space in the front of the connection string.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文