Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
'ObjConn_serverversion' threw an exception
ASWIN KUMAR
9y
524
1
Reply
Hello,
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.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Generate Gridview Based on Columns in Table of Sql server
Yahoo BOSS and OAuth