29 lines
734 B
C#
29 lines
734 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using MySql.Data.MySqlClient;
|
|
|
|
namespace WinFormsApp1
|
|
{
|
|
internal class DB
|
|
{
|
|
MySqlConnection connection = new MySqlConnection("server=85.239.57.125;port=3306;username=ISP41_Merkylov;password=ISP41_Merkylov;database=Merkylov_Sportmag");
|
|
public void openConnection()
|
|
{
|
|
if (connection.State == System.Data.ConnectionState.Closed)
|
|
connection.Open();
|
|
}
|
|
public void closeConnection()
|
|
{
|
|
if (connection.State == System.Data.ConnectionState.Open)
|
|
connection.Close();
|
|
}
|
|
public MySqlConnection getConnection()
|
|
{
|
|
return connection;
|
|
}
|
|
}
|
|
}
|
|
|