示例#1
0
        public virtual List <MySqlError> ReportWarnings(MySqlConnection connection)
        {
            List <MySqlError> warnings = new List <MySqlError>();

            MySqlCommand cmd = new MySqlCommand("SHOW WARNINGS", connection);

            cmd.InternallyCreated = true;
            using (MySqlDataReader reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    warnings.Add(new MySqlError(reader.GetString(0),
                                                reader.GetInt32(1), reader.GetString(2)));
                }
            }

            MySqlInfoMessageEventArgs args = new MySqlInfoMessageEventArgs();

            args.errors = warnings.ToArray();
            if (connection != null)
            {
                connection.OnInfoMessage(args);
            }
            return(warnings);
        }
示例#2
0
 internal void OnInfoMessage(MySqlInfoMessageEventArgs args)
 {
     if (InfoMessage != null)
     {
         InfoMessage(this, args);
     }
 }
示例#3
0
 internal void OnInfoMessage(MySqlInfoMessageEventArgs args)
 {
     if (InfoMessage != null)
     {
         InfoMessage(this, args);
     }
 }
示例#4
0
        public virtual List<MySqlError> ReportWarnings(MySqlConnection connection)
        {
            List<MySqlError> warnings = new List<MySqlError>();

            MySqlCommand cmd = new MySqlCommand("SHOW WARNINGS", connection);
            cmd.InternallyCreated = true;
            using (MySqlDataReader reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    warnings.Add(new MySqlError(reader.GetString(0),
                                  reader.GetInt32(1), reader.GetString(2)));
                }
            }

            MySqlInfoMessageEventArgs args = new MySqlInfoMessageEventArgs();
            args.errors = warnings.ToArray();
            if (connection != null)
                connection.OnInfoMessage(args);
            return warnings;
        }