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(); } }
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(); } }