During Open(), SqlConnection.ServerVersion throws System.InvalidOperationException
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 e开发者_如何转开发xception:
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
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.
精彩评论