| 13 | private List<Test> tests = new List<Test>(); |
| 14 | |
| 15 | public void Connect(string ip, int port, string user, string password) |
| 16 | { |
| 17 | string connectionString = $"Server={ip};Port={port};User Id={user};Password={password};"; |
| 18 | try |
| 19 | { |
| 20 | conn = new MySqlConnection(connectionString); |
| 21 | conn.Open(); |
| 22 | cmd = conn.CreateCommand(); |
| 23 | cmd.CommandType = CommandType.Text; |
| 24 | } |
| 25 | catch (MySqlException e) |
| 26 | { |
| 27 | throw new Exception($"Error connecting to database: {e.Message}", e); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | public void Disconnect() |
| 32 | { |