static Execute() { var path = Application.StartupPath + @"\DB\env.txt"; string[] lines = File.ReadAllLines(path); var parameters = new DBParameters(ConnectionType.MySQL, lines[1], lines[2], lines[3], lines[4], lines[5]); //var cs = "Data Source={0};Pooling=true;FailIfMissing=false;BinaryGUID=false;New=false;Compress=true;Version=3"; CONNECTION_STRING = parameters.ConnectionString; }
public MyConnection(DBParameters parameters) { _parameters = parameters; switch (_parameters.ConnectionType) { case ConnectionType.MySQL: mysql = new MySqlConnection(); break; case ConnectionType.SQLite3: sqlite = new SQLiteConnection(); break; } ConnectionType = _parameters.ConnectionType; }