MCPcopy Create free account
hub / github.com/apecloud/myduckserver / Connect

Method Connect

compatibility/mysql/csharp/MySQLTest.cs:15–29  ·  view source on GitHub ↗
(string ip, int port, string user, string password)

Source from the content-addressed store, hash-verified

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 {

Callers 1

MainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected