Beispiel #1
0
        private void menuClick(object sender, EventArgs e)
        {
            string Host     = (string)serverData.Rows[cmbServers.SelectedIndex]["host"];
            int    port     = unchecked ((int)(long)serverData.Rows[cmbServers.SelectedIndex]["port"]);
            string username = (string)serverData.Rows[cmbServers.SelectedIndex]["username"];
            string password = (string)serverData.Rows[cmbServers.SelectedIndex]["password"];

            mysql_servers server = new mysql_servers();

            server.host     = Host;
            server.port     = port;
            server.username = username;
            server.password = password;
            if (tvDatabases.SelectedNode != null && tvDatabases.SelectedNode.Parent == null)
            {
                string database = tvDatabases.SelectedNode.Text;
                if (sender.ToString() == "browse data")
                {
                    SqlDbViewerForm sqlform = new SqlDbViewerForm(server, database);
                    sqlform.Show();
                }
                else if (sender.ToString() == "inspect database")
                {
                    AnalyzeDbForm adbf = new AnalyzeDbForm(server, database);
                    adbf.Show();
                }
            }
            else
            {
                if (tvDatabases.SelectedNode != null && tvDatabases.SelectedNode.Parent != null)
                {
                    string database = tvDatabases.SelectedNode.Parent.Text;
                    if (sender.ToString() == "browse data")
                    {
                        SqlDbViewerForm sqlform = new SqlDbViewerForm(server, database);
                        sqlform.Show();
                    }
                    else if (sender.ToString() == "inspect database")
                    {
                        AnalyzeDbForm adbf = new AnalyzeDbForm(server, database);
                        adbf.Show();
                    }
                }
            }
        }
Beispiel #2
0
        private void menuClick(object sender, EventArgs e)
        {
            sqlservers server = DbUtils.getSqlServerFromTable(serverData, cmbServers);

            if (tvDatabases.SelectedNode != null && tvDatabases.SelectedNode.Parent == null)
            {
                string database = tvDatabases.SelectedNode.Text;
                if (sender.ToString() == "browse data")
                {
                    SqlDbViewerForm sqlform = new SqlDbViewerForm(server, database);
                    sqlform.Show();
                }
                else if (sender.ToString() == "inspect database")
                {
                    AnalyzeDbForm adbf = new AnalyzeDbForm(server, database);
                    adbf.Show();
                }
            }
            else
            {
                if (tvDatabases.SelectedNode != null && tvDatabases.SelectedNode.Parent != null)
                {
                    string database = tvDatabases.SelectedNode.Parent.Text;
                    if (sender.ToString() == "browse data")
                    {
                        SqlDbViewerForm sqlform = new SqlDbViewerForm(server, database);
                        sqlform.Show();
                    }
                    else if (sender.ToString() == "inspect database")
                    {
                        AnalyzeDbForm adbf = new AnalyzeDbForm(server, database);
                        adbf.Show();
                    }
                }
            }
        }