Example #1
0
        // Fires a single InfoMessageEvent
        private void FireInfoMessageEvent(SqlConnection connection, TdsParserStateObject stateObj, SqlError error)
        {
            string serverVersion = null;

            Debug.Assert(connection != null && _connHandler.Connection == connection);

            if (_state == TdsParserState.OpenLoggedIn)
            {
                serverVersion = _connHandler.ServerVersion;
            }

            SqlErrorCollection sqlErs = new SqlErrorCollection();

            sqlErs.Add(error);

            SqlException exc = SqlException.CreateException(sqlErs, serverVersion, _connHandler);

            bool notified;
            connection.OnInfoMessage(new SqlInfoMessageEventArgs(exc), out notified);
            if (notified)
            {
                // observable side-effects, no retry
                stateObj._syncOverAsync = true;
            }
            return;
        }
 private void FireInfoMessageEvent(SqlConnection connection, TdsParserStateObject stateObj, SqlError error)
 {
     string serverVersion = null;
     if (this._state == TdsParserState.OpenLoggedIn)
     {
         serverVersion = this._connHandler.ServerVersion;
     }
     SqlErrorCollection errorCollection = new SqlErrorCollection();
     errorCollection.Add(error);
     SqlException exception = SqlException.CreateException(errorCollection, serverVersion);
     connection.OnInfoMessage(new SqlInfoMessageEventArgs(exception));
 }