Exemplo n.º 1
1
        protected static void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
        {
            Console.WriteLine("SQL Info Message");

            foreach (SqlError err in args.Errors)
            {
                Console.WriteLine("The {0} has received a severity {1}, state {2} error number {3}\n" +
                                  "on line {4} of procedure {5} on server {6}:\n{7}",
                                  err.Source, err.Class, err.State, err.Number, err.LineNumber,
                                  err.Procedure, err.Server, err.Message);
            }
        }
Exemplo n.º 2
0
 private void Conn_InfoMessage(
     object sender,
     SqlInfoMessageEventArgs e)
 {
     if (_aConnection.Conn.State == ConnectionState.Closed)
     {
         return;
     }
     Console.WriteLine(e.Errors[0].Message);
     Console.ReadLine();
     if (e.Errors[0].Message == "Warning: Null value is eliminated by an aggregate or other SET operation.")
     {
     }
     else
     {
         MessageBox.Show
             (
                 "Error Recieved - Unable to perform query successfully\r\n\r\n" + e.Errors[0].Message
                 + "\r\n\r\n" +
                 _aSqlStatement,
                 "\r\n\r\nSQL Information Returned",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Information);
     }
     _aConnection.CloseConnection();
 }
		private void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
		{
			if(this.Provider.Log != null)
			{
				this.Provider.Log.WriteLine(Strings.LogGeneralInfoMessage(args.Source, args.Message));
			}
		}
Exemplo n.º 4
0
        internal static void InfoMessageHandler(object Sender,
            SqlInfoMessageEventArgs EventInfo)
        {
            File.AppendAllText(MessagesFile, EventInfo.Message + "\n", OutputEncoding);

            return;
        }
Exemplo n.º 5
0
 private void OnSqlInfoMessage(object sender,
                               System.Data.SqlClient.SqlInfoMessageEventArgs args)
 {
     foreach (SqlError err in args.Errors)
     {
         Logger.LogError("OnSqlInfoMessage", new Exception(err.Message));
     }
 }
Exemplo n.º 6
0
 protected void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
 {
     if (infoMessage.IsNull)
     {
         infoMessage = "";
     }
     infoMessage += args.Message + "\r\n";
 }
Exemplo n.º 7
0
 private static void OnInfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs args)
 {
     System.Data.SqlClient.SqlError sqlEvent = null;
     foreach (System.Data.SqlClient.SqlError sqlEvent_loopVariable in args.Errors)
     {
         sqlEvent = sqlEvent_loopVariable;
         aaa      = sqlEvent.Message;
     }
     //return aaa;
 }
 private static void SqlInfoHandler(object sqlConnection, SqlInfoMessageEventArgs e)
 {
     var stringBuilder = new StringBuilder("SQL Server Error in Custom Repository");
     for (int i = 0; i < e.Errors.Count; i++)
     {
         stringBuilder.Append(Environment.NewLine);
         stringBuilder.Append("ERROR #" + Convert.ToString(i + 1));
         stringBuilder.Append(e);
     }
     throw new Exception(stringBuilder.ToString());
 }
Exemplo n.º 9
0
        private void ConnectionOnInfoMessage(object sender, SqlInfoMessageEventArgs args)
        {
            if (string.IsNullOrEmpty(args.Message) && args.Errors.Count == 0)
                return;

            _log.Append(args.Message);
            foreach (SqlError error in args.Errors)
            {
                _log.AppendLine(error.Message);
            }
        }
Exemplo n.º 10
0
 private void InfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs e)
 {
     for (int i = 0; i < e.Errors.Count; i++)
     {
         using (TextWriterTraceListener SqlInfoMessageWriter = new TextWriterTraceListener(Console.Out))
         {
             Trace.Listeners.Add(SqlInfoMessageWriter);
             Trace.AutoFlush = true;
             Trace.WriteLine("SqlServer message: {0}", e.Errors[i].Message);
         }
     }
 }
Exemplo n.º 11
0
 private void OnSqlInfoMessage(object sender,
                               System.Data.SqlClient.SqlInfoMessageEventArgs args)
 {
     foreach (SqlError err in args.Errors)
     {
         ExceptionMessageBox emb = new ExceptionMessageBox();
         emb.Text = String.Format(System.Globalization.CultureInfo.InvariantCulture,
                                  Properties.Resources.SqlError,
                                  err.Source, err.Class, err.State, err.Number, err.LineNumber,
                                  err.Procedure, err.Server, err.Message);
         emb.Show(this);
     }
 }
Exemplo n.º 12
0
 private void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
 {
     if (args.Errors.Count > 0 )
     {
         serverInfos = args.Errors;
         // TODO: enable asynchronouse output to the gui
     //				StringBuilder builder = new StringBuilder();
     //				foreach(SqlError error in args.Errors)
     //				{
     //					builder.Remove(0, builder.Length - 1);
     //					builder.Append("***DBInfoMessage: severity = " + error.Number);
     //					builder.Append(", state = " + error.State + "\n");
     //					builder.Append("***\tmessage = " + error.Message);
     //					builder.Append(", procedure = " + error.Procedure);
     //					builder.Append(", line = " + error.LineNumber);
     //					Debug.Write(builder.ToString());
     //				}
     }
 }
        private void connInfoMessage(object sender, SqlInfoMessageEventArgs e)
        {
            bool founderrors = false;
            foreach (SqlError error in e.Errors)
            {
                if (error.Class > 10)
                {
                    AppendOutputText("Error !!! " + Environment.NewLine); ;
                    AppendOutputText(error.Message + Environment.NewLine);
                    founderrors = true;
                    Status = TaskStatus.Failed;
                    Log.Error("Error while executing SQL command:" + error.Message);
                }
            }

            if (!founderrors)
            {
                AppendOutputText(e.Message + Environment.NewLine);
            }
        }
Exemplo n.º 14
0
 private static void ConnectionInfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     if ( e.Errors.Count > 0 )
     {
         // Check to make sure we are information only messages
         Console.WriteLine("Recieved {0} messages", e.Errors.Count);
         foreach( SqlError info in e.Errors )
         {
             if ( info.Class > 9 ) // Severity
             {
                 Console.WriteLine("Error Message : {0} : State : {1}", info.Message, info.State );
             }
             else
             {
                 Console.WriteLine("Info Message : {0} : State : {1}", info.Message, info.State);
             }
         }
     }
     else
     {
         Console.WriteLine("Recieved Connection Info Message : {0}", e.Message);
     }
 }
Exemplo n.º 15
0
 private void OnSqlServerMessage(object sender, SqlInfoMessageEventArgs e)
 {
     if (null != OnMessage)
     {
         foreach (SqlError sqle in e.Errors)
         {
             if (!sqle.Message.StartsWith("Changed database context to"))
                 OnMessage(this, new MessageEventArgs(sqle.Message));
         }
     }
 }
Exemplo n.º 16
0
		private void OnSqlInfoMessage (SqlInfoMessageEventArgs value)
		{
			if (InfoMessage != null)
				InfoMessage (this, value);
		}
Exemplo n.º 17
0
 static void infoMessageHandler(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs e)
 {
     Logger.log(MethodBase.GetCurrentMethod(), e.Message);
 }
Exemplo n.º 18
0
        private void InfoMessage(object sender, SqlInfoMessageEventArgs e)
        {
            if (Logger == null)
                return;

            foreach (SqlError error in e.Errors)
                WriteLog("SQL Message '{0}',  Number: {1}, Procedure: '{2}', Line: {3}".FormatWith(
                    error.Message, error.Number, error.Procedure, error.LineNumber));
        }
Exemplo n.º 19
0
 void cnnSQL_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     Assert.Fail(e.Message);
 }
Exemplo n.º 20
0
 private void OnInfoMessageUpdated(object sender, SqlInfoMessageEventArgs e)
 {
     this.StatusMessage = e.Message;
 }
Exemplo n.º 21
0
        private void ConnectionContext_InfoMessage(object sender, SqlInfoMessageEventArgs e)
        {
            if (e.Message.Contains("ERROR"))
            {
                errors++;
                outputLog.Append(e.Message + Environment.NewLine);
                outputLog.Append("----------------------------------------------------------------------------------------------------------" + Environment.NewLine);
            }

            messageLog.Append(e.Message + Environment.NewLine);
            messageLog.Append("----------------------------------------------------------------------------------------------------------" + Environment.NewLine);
        }
Exemplo n.º 22
0
 private void sqlConnection1_InfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs e)
 {
 }
Exemplo n.º 23
0
 void Con_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     listBox1.Items.Add(e.Message);
 }
Exemplo n.º 24
0
 private void Cn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     //e.Erros --> solo errores
     this.lblMensaje.Text = e.Message;
     //throw new NotImplementedException();
 }
 void _Cn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     ///Double Check
     //ShowError(ErrorNumber.SetType("00000000", errorType.DataOperationError), e.Message);
 }
Exemplo n.º 26
0
 private void Connector_InfoMessageHandler(object sender, SqlInfoMessageEventArgs e)
 {
     InfoMessages = InfoMessages + e.Message + "\r\n";
     ErrorMessages = ErrorMessages + e.Errors + "\r\n";
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// sqlinfomessageeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this SqlInfoMessageEventHandler sqlinfomessageeventhandler, Object sender, SqlInfoMessageEventArgs e, AsyncCallback callback)
        {
            if(sqlinfomessageeventhandler == null) throw new ArgumentNullException("sqlinfomessageeventhandler");

            return sqlinfomessageeventhandler.BeginInvoke(sender, e, callback, null);
        }
Exemplo n.º 28
0
        internal void OnInfoMessage(SqlInfoMessageEventArgs imevent)
        {
            bool notified;

            OnInfoMessage(imevent, out notified);
        }
Exemplo n.º 29
0
		void conn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
		{
			StringBuilder sb = new StringBuilder();
			sb.AppendLine("from pipe");
			sb.AppendLine(e.Message);
			foreach (SqlError error in e.Errors)
			{
				sb.AppendLine(error.Message);
			}
			infoMessage = sb.ToString();
		}
Exemplo n.º 30
0
 protected void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
 {
     foreach (SqlError err in args.Errors)
     {
         _SqlCommandMsgs += err.Message + NL;
     }
 }
Exemplo n.º 31
0
		//Activate This Construntor to log All To Standard output
		//public TestClass():base(true){}

		//Activate this constructor to log Failures to a log file
		//public TestClass(System.IO.TextWriter tw):base(tw, false){}

		//Activate this constructor to log All to a log file
		//public TestClass(System.IO.TextWriter tw):base(tw, true){}

		//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES

		private void con_InfoMessage(object sender, SqlInfoMessageEventArgs e)
		{
			errorCounter++;
		}
Exemplo n.º 32
0
        void conn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
        {
            foreach(SqlError err in e.Errors) {
                if(err.Message == "+")
                    Writer.EnterObject((ObjectNode)writeQueue.Dequeue());
                else if(err.Message == "-")
                    Writer.LeaveObject((ObjectNode)writeQueue.Dequeue());
                else if(err.Message.StartsWith("="))
                    Writer.WriteField((FieldNode)writeQueue.Dequeue(), err.Message.Substring(1));
                else
                    errors.Add(err);
            }

            int writesDone = writeCount - writeQueue.Count;

            if(writesDone - lastWriteReport > 100) {
                lastWriteReport = writesDone;

                if(options.ProgressHandler != null)
                    options.ProgressHandler(this, writesDone, writeCount);
            }
        }
Exemplo n.º 33
0
 internal void OnInfoMessage(SqlInfoMessageEventArgs imevent, out bool notified)
 => throw new PlatformNotSupportedException(EXCEPTION_MESSAGE);
Exemplo n.º 34
0
 internal static void InfoMessageHandler(object sender, SqlInfoMessageEventArgs e)
 {
     System.Diagnostics.Trace.WriteLine(e.ToString(), string.Format("{0}[{1}]", typeof(Role_FeatureDb).FullName, e.Errors[0].Procedure));
 }
        void StoredProcedure_InfoMessage(object sender, SqlInfoMessageEventArgs e)
        {
            foreach (SqlError error in e.Errors)
            {
                Logger.Error(String.Format("Error While Execute StoredProcedure: {0} - {1}", error.Procedure, error.Message));
            }
            ppWait.Invoke(new MethodInvoker(() =>
            {
                ppWait.Description = e.Message;
                //ppWait.Refresh();
                //Application.DoEvents();

            }));
        }
Exemplo n.º 36
0
 void con_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     lbLog.Items.Add("INFO: " + e.Message);
 }
Exemplo n.º 37
0
 private void cn_InfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs e)
 {
     Trace.WriteLine(e.Message);
 }
Exemplo n.º 38
0
 void _conn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
   _builder.AppendLine(e.Message);
 }
Exemplo n.º 39
0
 private void DisplayInfoMessage(object sender, SqlInfoMessageEventArgs e)
 {
     Trace.WriteLine(e.Message);
 }