コード例 #1
0
        public IManagedDatabase ChooseDatabase(string databaseName)
        {
            var connectionInfo = new DatabaseConnectionInfo(DataProvider.Connection.ConnectionString);

            ConnectionString = string.Format("{0} Database = {1};", connectionInfo.ServerConnectString, databaseName);

            DataProvider.Connect(ConnectionString, _dataProviderInfo);

            return(this);
        }
コード例 #2
0
        public string GetDatabaseInUse()
        {
            string connectionString = _databaseSettings.GetConnectionStringFor(_managedDatabase.DataProviderInfo);

            var connectionInfo = new DatabaseConnectionInfo(connectionString);

            if (_managedDatabase.DataProviderInfo.IsEmbedded)
            {
                return(connectionInfo.Database);
            }

            return(connectionInfo.IsValidForDatabaseConnection() ? connectionInfo.Database : null);
        }
コード例 #3
0
        bool ServerConnectStringIsInvalid(string serverConnectString)
        {
            var databaseConnectionInfo = new DatabaseConnectionInfo(serverConnectString);

            if (databaseConnectionInfo.IsValidForServerOnlyConnection())
            {
                return(false);
            }

            PublishErrorMessage(
                string.Format(Resources.Error_SettingsContainInvalidServerConnectString, _dataProviderInfo.NiceName));

            return(true);
        }