Пример #1
0
        //http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html
        public MySqlCharacterSetSchemaCollection GetCharacterSets()
        {
            MySqlCharacterSetSchemaCollection characterSets = new MySqlCharacterSetSchemaCollection();

            using (IPooledDbConnection conn = connectionPool.Request()) {
                using (IDbCommand command = conn.CreateCommand("SHOW CHARACTER SET;")) {
                    try {
                        using (IDataReader r = command.ExecuteReader()) {
                            while (r.Read())
                            {
                                MySqlCharacterSetSchema charset = new MySqlCharacterSetSchema(this);
                                charset.Name    = r.GetString(0);
                                charset.Comment = r.GetString(1);
                                charset.DefaultCollactionName = r.GetString(2);
                                charset.MaxLength             = r.GetInt32(3);
                                characterSets.Add(charset);
                            }
                            r.Close();
                        }
                    } catch (Exception e) {
                        QueryService.RaiseException(e);
                    } finally {
                        conn.Release();
                    }
                }
            }
            return(characterSets);
        }
Пример #2
0
        public void Initialize(MySqlSchemaProvider provider)
        {
            ClearCombos();
            MySqlCharacterSetSchemaCollection charsets   = provider.GetCharacterSets();
            MySqlCollationSchemaCollection    collations = provider.GetCollations();

            foreach (MySqlCharacterSetSchema charset in charsets)
            {
                storeCharset.AppendValues(charset.Name, charset);
            }

            foreach (MySqlCollationSchema collation in collations)
            {
                storeCollation.AppendValues(collation.Name, collation);
            }
        }
Пример #3
0
 public MySqlCharacterSetSchemaCollection(MySqlCharacterSetSchemaCollection collection)
     : base(collection, true)
 {
 }