Ejemplo n.º 1
0
        public Formulario()
        {
            InitializeComponent();

            MySQL_Connection = new MySQL_DB();
            MySQL_Connection.SetConnection("db4free.net", "3306", "taskuser", "task747", "taskplanner");
            //MySQL_Connection.debug = true;
            this.PANEL.Controls.Add(this.elementHost);
            this.elementHost.Dock  = System.Windows.Forms.DockStyle.Fill;
            this.elementHost.Child = new Login(this, MySQL_Connection);
        }
Ejemplo n.º 2
0
        private void BTN_SAVE_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Connection.SetConnection(TXT_SERVIDOR.Text.Trim(), TXT_PUERTO.Text.Trim(), TXT_USUARIO.Text.Trim(), TXT_PASSWORD.Password, TXT_DATABASE.Text.Trim());

            if (Connection.testConnection())
            {
                MessageBox.Show("Se ha podido establecer conexión con el servidor satisfactoriamente", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Error, no se ha podido establecer conexión con el servidor. \nComprueba tu configuración e intentalo de nuevo.", "Información", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
        }