Click here to Skip to main content
12,359,458 members (48,430 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
ExecuteReader requires an open and available Connection. The connection's current state is closed.

guys please help with this.
Posted 14-Jan-13 10:12am
Updated 14-Jan-13 10:15am
richcb 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...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100