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

Total Post:214

Points:1642
C#  .NET  SQL Server  SQL 
C#
 1671  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. Post:131

    Points:943
    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!!!

      Modified On Apr-11-2018 01:46:11 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.