views:

208

answers:

2

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

A: 

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?

Tim Goodman
The connection string is same for both environments, same copy of web.config
Larry
I'm glad you found your problem with the connection string. If my reply was helpful, please consider marking it as the answer. (I'm trying to get to however many reputation points I need to post comments on other people's answers.)
Tim Goodman
A: 

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

Larry

related questions