Example #1
0
        /// <summary>
        /// PropertyGrid's datasource setting.
        /// </summary>
        /// <param name="server"></param>
        private void SetPropertyObject(Server server)
        {
            switch (server.Engine)
            {
            case Engine.SqlServer:
                propertyGrid.SelectedObject = BuilderProvider.SqlConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            case Engine.MySql:
                propertyGrid.SelectedObject = BuilderProvider.MySqlConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            case Engine.PostgreSql:
                propertyGrid.SelectedObject = BuilderProvider.PGSqlConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            case Engine.MariaDB:
                propertyGrid.SelectedObject = BuilderProvider.MySqlConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            case Engine.SQLite:
                propertyGrid.SelectedObject = BuilderProvider.SqliteConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            case Engine.Oracle:
                propertyGrid.SelectedObject = BuilderProvider.OracleConnectionStringBuilder(server.Connection.ConnectionString);
                break;

            default:
                propertyGrid.SelectedObject = null;
                break;
            }
        }
Example #2
0
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            var server  = new Server("Default", Engine.SqlServer);
            var builder = BuilderProvider.SqlConnectionStringBuilder();

            builder.DataSource                 = "localhost";
            builder.IntegratedSecurity         = true;
            server.Connection.ConnectionString = builder.ToString();

            var databases = new SchemaModel(server).GetDatabaseList();

            select_Database.Items.AddRange(databases.ToArray());
            select_Database.SelectedIndex = 0;

            FormConfiguration.Apply(this);
        }
Example #3
0
        public MainForm()
        {
            InitializeComponent();

            var server  = new Server("てすと1", Engine.SqlServer);
            var builder = BuilderProvider.SqlConnectionStringBuilder();

            builder.DataSource                 = "localhost";
            builder.IntegratedSecurity         = true;
            server.Connection.ConnectionString = builder.ToString();
            var server2 = new Server("てすと2", Engine.SQLite);
            var servers = new Servers()
            {
                server,
                server2
            };

            new ConnectionForm(servers).Show();
        }