I am trying to connect to the Database from the application and its not happening at all. The same DLL is working fine in QA and production.
When debugging I understood the SQL connection is always closed.
when I checked the below line of code,
public static SqlConnection objConn = new SqlConnection(strConnStr);
For objConn I was able to see an exception "'ObjConn_serverversion' threw an exception of type System.InvalidOperationException" and the state was CLOSED.
Please let us know whether you can help me with this.
Connection String:
During debug I found the below error message in objConn
Hide Copy Code
public static SqlConnection objConn = new SqlConnection(strConnStr);ServerVersion --> 'objConn.ServerVersion' threw an exception of type 'System.InvalidOperationException'
State --> Closed
Source code was initially developed in VS 2008. Now when I opened the solution it automatically takes me to Visual studio 2010 Conversion wizard, I am not sure whether this is something to do with this.
Replies
Know the answer? Post it — somebody with the same question will find it here.