Npgsql.NpgsqlCommand.CheckConnectionState C# (CSharp) 메소드

CheckConnectionState() 개인적인 메소드

This method checks the connection state to see if the connection is set or it is open. If one of this conditions is not met, throws an InvalidOperationException
private CheckConnectionState ( ) : void
리턴 void
        private void CheckConnectionState()
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "CheckConnectionState");

            // Check the connection state.
            if (Connector == null || Connector.State == ConnectionState.Closed)
            {
                throw new InvalidOperationException(resman.GetString("Exception_ConnectionNotOpen"));
            }
            if (Connector.State != ConnectionState.Open)
            {
                throw new InvalidOperationException(
                    "There is already an open DataReader associated with this Command which must be closed first.");
            }
        }