Beispiel #1
0
        public MySqlCollationSchemaCollection GetCollations(MySqlCharacterSetSchema characterSet)
        {
            MySqlCollationSchemaCollection collations = new MySqlCollationSchemaCollection();

            using (IPooledDbConnection conn = connectionPool.Request()) {
                using (IDbCommand command = conn.CreateCommand(String.Format("SHOW COLLATION LIKE '{0}%';",
                                                                             characterSet.Name))) {
                    try {
                        using (IDataReader r = command.ExecuteReader()) {
                            while (r.Read())
                            {
                                MySqlCollationSchema collation = new MySqlCollationSchema(this);
                                collation.Name             = r.GetString(0);
                                collation.CharacterSetName = r.GetString(1);
                                collation.Id = r.GetInt32(2);
                                collation.IsDefaultCollation = r.GetString(3) == "Yes" ? true : false;
                                collation.IsCompiled         = r.GetString(4) == "Yes" ? true : false;
                                collation.SortLength         = r.GetInt32(5);
                                collations.Add(collation);
                            }
                            r.Close();
                        }
                    } catch (Exception e) {
                        QueryService.RaiseException(e);
                    } finally {
                        conn.Release();
                    }
                }
            }
            return(collations);
        }
		public MySqlCollationSchema (MySqlCollationSchema schema)
			: base (schema)
		{
			id = schema.id;
			isDefaultCollation = schema.isDefaultCollation;
			isCompiled = schema.isCompiled;
			sortLength = schema.sortLength;
		}
Beispiel #3
0
 public MySqlCollationSchema(MySqlCollationSchema schema)
     : base(schema)
 {
     id = schema.id;
     isDefaultCollation = schema.isDefaultCollation;
     isCompiled         = schema.isCompiled;
     sortLength         = schema.sortLength;
 }
		public MySqlCollationSchemaCollection GetCollations (MySqlCharacterSetSchema characterSet)
		{
			MySqlCollationSchemaCollection collations = new MySqlCollationSchemaCollection ();

			using (IPooledDbConnection conn = connectionPool.Request ()) {
				using (IDbCommand command = conn.CreateCommand (String.Format ("SHOW COLLATION LIKE '{0}%';", 
																				characterSet.Name))) {
					
					try {
						using (IDataReader r = command.ExecuteReader ()) {
							while (r.Read ()) {
								MySqlCollationSchema collation = new MySqlCollationSchema (this);
								collation.Name = r.GetString (0);
								collation.CharacterSetName = r.GetString (1);
								collation.Id = r.GetInt32 (2);
								collation.IsDefaultCollation = r.GetString (3) == "Yes" ? true : false;
								collation.IsCompiled = r.GetString (4) == "Yes" ? true : false;
								collation.SortLength = r.GetInt32 (5);
								collations.Add (collation);
							}
							r.Close ();
						}
					} catch (Exception e) {
						QueryService.RaiseException (e);
					} finally {
						conn.Release ();
					}					
				}
			}
			return collations;
		}