Пример #1
0
 protected override ConnectionSettingsWidget CreateConnectionSettingsWidget(IDbFactory factory)
 {
     connectionWidget = new ConnectionSettingsWidget(factory);
     connectionWidget.ShowSettings(factory.GetDefaultConnectionSettings());
     connectionWidget.EnableTestButton = false;
     return(connectionWidget);
 }
        protected override ConnectionSettingsWidget CreateConnectionSettingsWidget(IDbFactory factory)
        {
            connectionWidget = new SqliteConnectionSettingsWidget(factory);
            connectionWidget.ShowSettings(factory.GetDefaultConnectionSettings());
            connectionWidget.EnableOpenButton = true;
            connectionWidget.EnableTestButton = false;

            DatabaseConnectionSettings settings = new DatabaseConnectionSettings(connectionWidget.ConnectionSettings);

            // Set a temp database to avoid exception of the default connection pool.
            settings.Database = System.IO.Path.GetTempFileName();
            // Create Context, Pool, Connection
            DatabaseConnectionContext ctx = new DatabaseConnectionContext(settings, true);

            ctx.ConnectionPool.Initialize();
            this.DatabaseConnection = ctx;
            return(connectionWidget);
        }