예제 #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)
 {
 }