EXECUTEREADER REQUIRES AN OPEN AND AVAILABLE CONNECTION. THE CONNECTION'S CURRENT STATE IS CLOSED.

Tarun Kumar

Total Post:214

Points:1642
Posted by  Tarun Kumar
C#  .NET  SQL Server  SQL 
C#
 979  View(s)
Ratings:
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

  1. Uttam Misra

    Post:126

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

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

    if (_conn.State == ConnectionState.Closed)

    _conn.Open();


    Happy Coding!!!

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!