Пример #1
0
        /// <summary>
        /// Called when an error message came from SqlClient
        /// </summary>
        /// <param name="e"></param>
        private void RaiseBatchError(BatchErrorEventArgs e)
        {
            EventHandler <BatchErrorEventArgs> cache = BatchError;

            if (cache != null)
            {
                cache(this, e);
            }
        }
Пример #2
0
        /// <summary>
        /// Fires an error message event
        /// </summary>
        /// <param name="ex">Exception caught</param>
        /// <remarks>
        /// Non-SQL exception
        /// </remarks>
        protected void HandleExceptionMessage(Exception ex)
        {
            BatchErrorEventArgs args = new BatchErrorEventArgs(string.Format(CultureInfo.CurrentCulture, SR.EE_BatchError_Exception, ex.Message), ex);

            RaiseBatchError(args);
        }
Пример #3
0
        /// <summary>
        /// Called when an error message came from SqlClient
        /// </summary>
        /// <param name="message"></param>
        /// <param name="description"></param>
        /// <param name="line"></param>
        /// <param name="textSpan"></param>
        private void RaiseBatchError(string message, SqlError error, TextSpan textSpan)
        {
            BatchErrorEventArgs args = new BatchErrorEventArgs(message, error, textSpan, null);

            RaiseBatchError(args);
        }