summaryrefslogtreecommitdiff
path: root/kurier/Form1.cs
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-12 20:59:25 +0200
committeremkael <emkael@tlen.pl>2018-10-12 20:59:25 +0200
commit74202e8d091886e703af302dff8ee59560d1f85a (patch)
treead84ed76878b470050cf0151ed455ca9ba4968ef /kurier/Form1.cs
parent0550305e3f1f2558588b6b87a8c1b4004437ad3b (diff)
Listing MySQL DBs
Diffstat (limited to 'kurier/Form1.cs')
-rw-r--r--kurier/Form1.cs16
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();
}
}
}