// MySQL public static void Open(Forms.frm_MainWindow _mw, string server, string database, string username, string password, QueryLanguage ql) { mw = _mw; using (MySqlConnection con = new MySqlConnection("Server=" + server + ";Database=" + database + ";Uid=" + username + ";Pwd=" + password + "; CharSet=utf8;")) { // Checks if table exists or not. If it doesn't, create it. If not, continue. CheckIfMySqlTableExists(con, database, ql); MySqlTableLength = 0; // Inserts data into database InsertIntoMySqlDatabase(con, ql); } }
// SQL Server public static void Open(Forms.frm_MainWindow _mw, string connectionString, QueryLanguage ql) { mw = _mw; using (SqlConnection con = new SqlConnection(connectionString)) { // Checks if table exists or not. If it doesn't, create it. If not, continue. CheckIfSqlServerTableExists(con, ql); SqlServerTableLength = 0; // Inserts data into database InsertIntoSqlServerDatabase(con, ql); } }