CqlSharp.CqlConnection.ChangeDatabase C# (CSharp) Метод

ChangeDatabase() публичный Метод

Changes the current database for an open connection.
/// CqlConnection must be open before Database can be changed. /// or /// Changing a database is only supported with a ConnectionStrategy that offers exclusive connections ///
public ChangeDatabase ( string databaseName ) : void
databaseName string Specifies the name of the database for the connection to use.
Результат void
        public override void ChangeDatabase(string databaseName)
        {
            if(State != ConnectionState.Open)
                throw new InvalidOperationException("CqlConnection must be open before Database can be changed.");

            if(!Cluster.ConnectionStrategy.ProvidesExclusiveConnections)
            {
                throw new InvalidOperationException(
                    "Changing a database is only supported with a ConnectionStrategy that offers exclusive connections");
            }

            _database = databaseName;
        }