public virtual SqlServerCollationSchemaCollection GetCollations() { SqlServerCollationSchemaCollection collations = new SqlServerCollationSchemaCollection(); using (IPooledDbConnection conn = connectionPool.Request()) { conn.DbConnection.ChangeDatabase("master"); using (IDbCommand command = conn.CreateCommand("SELECT * FROM ::fn_helpcollations()")) { try { using (IDataReader reader = command.ExecuteReader()) { while (reader.Read()) { SqlServerCollationSchema coll = new SqlServerCollationSchema(this); coll.Name = reader.GetString(0); coll.Description = reader.GetString(1); collations.Add(coll); } reader.Close(); } } catch (IOException ioex) { //FIXME: Avoid an IOException AND ObjectDisposedException (https://bugzilla.novell.com/show_bug.cgi?id=556406) } catch (ObjectDisposedException dex) { } catch (Exception e) { QueryService.RaiseException(e); } finally { connectionPool.Release(conn); } } } return(collations); }
public void Initialize(SqlServerSchemaProvider provider) { SqlServerCollationSchemaCollection collations = provider.GetCollations(); Console.WriteLine(collations.Count); foreach (SqlServerCollationSchema coll in collations) { storeCollations.AppendValues(string.Format("{0} - {1}", coll.Name, coll.Description), coll); } }
public SqlServerCollationSchemaCollection(SqlServerCollationSchemaCollection collection) : base(collection, true) { }