Example #1
0
        public void connectToDBMS()
        {
            DatabasesForm form2   = new DatabasesForm();
            ConnString    connect = new ConnString();

            conn = new MySqlConnection();
            if (connection == false)
            {
                conn.ConnectionString = connect.getConnString();
                conn.Open();
                connection = true;
            }
            if (connection == true)
            {
                MessageBox.Show("Connection Successful");
                form2.Show();
            }
        }
Example #2
0
        public void connectToDBMS(ConnString cs)
        {
            DatabasesForm form2   = new DatabasesForm(cs);
            ConnString    connect = cs;

            mySqlConnection = new MySqlConnection();
            if (connection == false)
            {
                mySqlConnection.ConnectionString = connect.GetConStr();
                mySqlConnection.Open();
                connection = true;
            }
            if (connection == true)
            {
                MessageBox.Show("Connection Successful");
                form2.Show();
            }
        }