在 Open() 期间,SqlConnection.ServerVersion 抛出 System.InvalidOperationException
当运行网络服务时,网页知道如何响应。该服务连接到数据库。在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能是由于实时服务器和开发计算机之间的 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?
发现问题了。连接字符串前面有一个空格。
Found problem. There was a space in the front of the connection string.