Home > DeveloperSection > Forums > ExecuteReader requires an open and available Connection. The connection's current state is closed.
Tarun Kumar

Total Post:213

Points:1635
Posted on    February-24-2016 3:18 AM

 C# C#  .NET  SQL Server  SQL 
Ratings:


 1 Reply(s)
 416  View(s)
Rate this:
Hi everyone,
When trying to connect to MSSQL Server I am getting following error

ExecuteReader requires an open and available Connection. The connection's current state is closed.

Please help



Uttam Misra

Total Post:125

Points:897
Supported
Posted on    February-24-2016 3:22 AM

I think you forgot to open your connection.
check following line of code:

if (_conn.State == ConnectionState.Closed)

_conn.Open();


Happy Coding!!!


Don't want to miss updates? Please click the below button!

Follow MindStick