Setup and forms
This commit is contained in:
1 parent
aed55f44f9
commit
eee7548fc8
47 files changed
+2837
-8138
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Data.SqlClient;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
namespace PaymentLogs
|
||||
{
|
||||
internal class DataBase
|
||||
{
|
||||
private string _server = "mysql3.joinserver.xyz";
|
||||
private string _user = "u45925_kkOETa8Au9";
|
||||
private string _pass = "S^Xv9WH9PM!a@.cWHCRJVr.Z";
|
||||
private string _db = "s45925_easystartup";
|
||||
private MySqlConnection mySqlConnection;
|
||||
|
||||
//SqlConnection sqlConnection = new SqlConnection(@"Data Source=DESKTOP-QN8TL8D\SQLEXPRESS;Initial Catalog=Отчет оплаты обучения обучающихся;Integrated Security=True");
|
||||
|
||||
public void openConnection()
|
||||
{
|
||||
mySqlConnection = new MySqlConnection($"Server={_server}; Port=3306; Uid={_user}; Pwd={_pass}; Database={_db}");
|
||||
if (mySqlConnection.State == System.Data.ConnectionState.Closed)
|
||||
{
|
||||
mySqlConnection.Open();
|
||||
}
|
||||
}
|
||||
|
||||
public void closeConnection()
|
||||
{
|
||||
if (mySqlConnection.State ==System.Data.ConnectionState.Closed)
|
||||
{
|
||||
mySqlConnection.Open();
|
||||
}
|
||||
}
|
||||
|
||||
public MySqlConnection getConnection()
|
||||
{
|
||||
return mySqlConnection;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user