Пример #1
0
        private void btnSetConnection_Click(object sender, EventArgs e)
        {
            var dcf    = new DatabaseConfigurationForm();
            var result = dcf.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                var cm = ConnectionManager.GetDefaultConnection();

                txtConnStr.Text = cm.ConnectionString;
                SetDatabaseConnectionState(cm.IsReady);
            }
        }
Пример #2
0
        public void LoadConfigFile()
        {
            Task.Run(async() =>
            {
                if (File.Exists(DatabaseConfigurationForm.ConfigPath))
                {
                    var config      = await DatabaseConfigurationForm.ReadTextAsync(DatabaseConfigurationForm.ConfigPath);
                    var conn        = Connection.Parse(config);
                    txtConnStr.Text = conn.ConnectionString;

                    ConnectionManager.Add(conn, conn.Name);
                    ConnectionManager.SetToDefaultConnection(conn.Name);

                    await ConnectionManager.GetDefaultConnection().CheckDbConnectionAsync();
                }
            });
        }
Пример #3
0
        private void btnSetConnection_Click(object sender, EventArgs e)
        {
            var dcf = new DatabaseConfigurationForm();
            var result = dcf.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                var cm = ConnectionManager.GetDefaultConnection();

                txtConnStr.Text = cm.ConnectionString;
                SetDatabaseConnectionState(cm.IsReady);
            }
        }