Exemple #1
0
        public virtual List <MyCatError> ReportWarnings(MyCatConnection connection)
        {
            List <MyCatError> warnings = new List <MyCatError>();

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

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

            MyCatInfoMessageEventArgs args = new MyCatInfoMessageEventArgs();

            args.errors = warnings.ToArray();
            if (connection != null)
            {
                connection.OnInfoMessage(args);
            }
            return(warnings);
        }
 internal void OnInfoMessage(MyCatInfoMessageEventArgs args)
 {
     if (InfoMessage != null)
     {
         InfoMessage(this, args);
     }
 }