Ejemplo n.º 1
0
        private void RemoteConnection(Config nConfig)
        {
            this.ssh = new SshDbWrapper(nConfig.SSH_HOST,
                                        nConfig.SSH_USER,
                                        nConfig.SSH_PASSW,
                                        nConfig.DB_HOST,
                                        nConfig.DB_PORT,
                                        nConfig.DB_USER,
                                        nConfig.DB_SCHEMA,
                                        nConfig.DB_PASSWORD);
            ssh.Connect();
            List <String> tableList = ssh.TableList();

            ssh.Disconnect();


            //assign a contextmenustrip
            listboxContextMenu          = new ContextMenuStrip();
            listboxContextMenu.Opening += new CancelEventHandler(listboxContextMenu_Opening);
            listBox1.ContextMenuStrip   = listboxContextMenu;

            listBox1.Items.Clear();
            foreach (String table in tableList)
            {
                listBox1.Items.Add(table);
            }
        }
Ejemplo n.º 2
0
 private void DML_Load(object sender, EventArgs e)
 {
     this.ssh = new SshDbWrapper(RemoteConfig.SSH_HOST,
                                 RemoteConfig.SSH_USER,
                                 RemoteConfig.SSH_PASSW,
                                 RemoteConfig.DB_HOST,
                                 RemoteConfig.DB_PORT,
                                 RemoteConfig.DB_USER,
                                 RemoteConfig.DB_SCHEMA,
                                 RemoteConfig.DB_PASSWORD);
     QuerySelect();
 }
Ejemplo n.º 3
0
        private void ExecuteSql_Load(object sender, EventArgs e)
        {
            txtScript.Text = ScriptText;

            this.ssh = new SshDbWrapper(Configuration.SSH_HOST,
                                        Configuration.SSH_USER,
                                        Configuration.SSH_PASSW,
                                        Configuration.DB_HOST,
                                        Configuration.DB_PORT,
                                        Configuration.DB_USER,
                                        Configuration.DB_SCHEMA,
                                        Configuration.DB_PASSWORD);
        }
Ejemplo n.º 4
0
        private List <DBColumn> GetMissingColumn(string table,
                                                 SshDbWrapper sourceConnection,
                                                 SshDbWrapper destinationConnection)
        {
            DescribeOutput  sourceTabDescription      = sourceConnection.Describe(table);
            DescribeOutput  destinationTabDescription = destinationConnection.Describe(table);
            List <DBColumn> missingColumns            = new List <DBColumn>();

            foreach (DBColumn col in sourceTabDescription.Columns)
            {
                if (!ExistColumn(destinationTabDescription, col))
                {
                    missingColumns.Add(col);
                }
            }
            return(missingColumns);
        }
Ejemplo n.º 5
0
        private void btnDdlCompare_Click(object sender, EventArgs e)
        {
            Config source      = ConfigList[(String)ddlListConnection1.SelectedItem];
            Config destination = ConfigList[(String)ddlListConnection2.SelectedItem];

            SourceConnection = new SshDbWrapper(source.SSH_HOST,
                                                source.SSH_USER,
                                                source.SSH_PASSW,
                                                source.DB_HOST,
                                                source.DB_PORT,
                                                source.DB_USER,
                                                source.DB_SCHEMA,
                                                source.DB_PASSWORD);

            DestinationConnection = new SshDbWrapper(destination.SSH_HOST,
                                                     destination.SSH_USER,
                                                     destination.SSH_PASSW,
                                                     destination.DB_HOST,
                                                     destination.DB_PORT,
                                                     destination.DB_USER,
                                                     destination.DB_SCHEMA,
                                                     destination.DB_PASSWORD);

            SourceConnection.Connect();
            DestinationConnection.Connect();

            lstBox1.Items.Clear();
            foreach (String table in SourceConnection.TableList())
            {
                lstBox1.Items.Add(table);
            }
            lstBox2.Items.Clear();
            foreach (String table in DestinationConnection.TableList())
            {
                lstBox2.Items.Add(table);
            }


            SourceConnection.Disconnect();
            DestinationConnection.Disconnect();
        }