Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
ExecuteReader requires an open and available Connection. The connection's current state is closed.


guys please help with this.
Posted
Updated 14-Jan-13 10:15am
v2
Comments
Richard C Bishop 14-Jan-13 16:29pm    
This is not a question, it is two sentences without any context, code, or direction.
Sergey Alexandrovich Kryukov 14-Jan-13 16:36pm    
Exactly. I'm not deleting it only one answer is already there. Generally, we should avoid providing answers to such "questions"; attempting to do so would lead us too far...
—SA

The message is clear: the connection property of your object must be a valid reference to an open connection. If the connection is closed then the method throws such an exception. See, for instance, SqlCommand.ExecuteReader[^] at MSDN.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900