コード例 #1
0
ファイル: ConfigurationDialog.cs プロジェクト: mirkomaty/NDO
        private void btnNewDatabase_Click(object sender, System.EventArgs e)
        {
            string connType = cbSqlDialect.Text;

            if (connType == string.Empty)
            {
                connType = "SqlServer";
            }
            IDbUISupport provider = NdoUIProviderFactory.Instance[connType];

            if (provider == null)
            {
                MessageBox.Show("Can't find a NDO UI provider for the sql dialect " + connType);
                return;
            }
            object necessaryData = null;

            try
            {
                if (provider.ShowCreateDbDialog(ref necessaryData) == NdoDialogResult.Cancel)
                {
                    return;
                }
                this.txtConnectionString.Text = provider.CreateDatabase(necessaryData);
            }
            catch (Exception ex)
            {
#if !DEBUG
                MessageBox.Show("Can't construct the database: " + ex.Message);
#else
                MessageBox.Show("Can't construct the database: " + ex.ToString());
#endif
            }
        }
コード例 #2
0
        public DefaultCreateDbDialog(IDbUISupport provider, NDOCreateDbParameter data)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            if (data != null)
            {
                this.txtConnection.Text = SaveString(data.ConnectionString);
                this.txtDbName.Text     = SaveString(data.DatabaseName);
            }

            this.provider = provider;
        }