diff options
Diffstat (limited to 'kurier/Form1.cs')
-rw-r--r-- | kurier/Form1.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kurier/Form1.cs b/kurier/Form1.cs index eb6ab88..a8bd7eb 100644 --- a/kurier/Form1.cs +++ b/kurier/Form1.cs @@ -5,6 +5,7 @@ using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; +using MySql.Data.MySqlClient; namespace kurier { @@ -29,11 +30,26 @@ namespace kurier { if (!MySQL.getConfigured()) (new MysqlSettings()).ShowDialog(); if (!MySQL.getConfigured()) this.Dispose(); + this.refreshDatabaseList(); } private void bSettings_Click(object sender, EventArgs e) { (new MysqlSettings()).ShowDialog(); + this.refreshDatabaseList(); + } + + internal void refreshDatabaseList() + { + this.cbDatabaseName.Items.Clear(); + MySQL c = new MySQL(""); + MySqlDataReader dbs = c.select("SELECT TABLE_SCHEMA FROM information_schema.COLUMNS GROUP BY TABLE_SCHEMA;"); + while (dbs.Read()) + { + this.cbDatabaseName.Items.Add(dbs.GetString(0)); + } + this.cbDatabaseName.SelectedIndex = 0; + dbs.Close(); } } } |