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 } }
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; }