mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
22 lines
539 B
C#
22 lines
539 B
C#
|
|
using MySql.Data.MySqlClient;
|
|||
|
|
|
|||
|
|
namespace cicm_web.Database
|
|||
|
|
{
|
|||
|
|
public class Mysql
|
|||
|
|
{
|
|||
|
|
MySqlConnection connection;
|
|||
|
|
|
|||
|
|
public Mysql(string server, string user, string database, ushort port, string password)
|
|||
|
|
{
|
|||
|
|
string connectionString =
|
|||
|
|
$"server={server};user={user};database={database};port={port};password={password}";
|
|||
|
|
|
|||
|
|
connection = new MySqlConnection(connectionString);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
~Mysql()
|
|||
|
|
{
|
|||
|
|
connection?.Close();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|