Ejemplo n.º 1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string serverURI = uri_form.Text;
            string user_cred = user_form.Text;
            string pass_cred = pass_form.Password;
            string db        = db_form.Text;

            sql_object sqlobj = new sql_object();

            sqlobj.login    = user_cred;
            sqlobj.password = pass_cred;
            sqlobj.uri      = serverURI;
            sqlobj.database = db;

            myConnectionString = $"server={serverURI};uid={user_cred};" +
                                 $"pwd={pass_cred};database = {db};";

            try
            {
                //testing connection for login before proceeding
                conn = new MySql.Data.MySqlClient.MySqlConnection();
                conn.ConnectionString = myConnectionString;
                conn.Open();
                editor_window win2 = new editor_window(sqlobj);
                win2.Show();
                this.Close();
            } catch (MySql.Data.MySqlClient.MySqlException ex) {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.editor_window1 = ((SQLViewer.editor_window)(target));
                return;

            case 2:
                this.table_comboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 13 "..\..\editor_window.xaml"
                this.table_comboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.table_comboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.dataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }