55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using auto_repair_shop;
|
|
using MySql.Data.MySqlClient;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace stratulat_modul
|
|
{
|
|
internal static class Program
|
|
{
|
|
/// <summary>
|
|
/// Главная точка входа для приложения.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new Form1());
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class Dbs
|
|
{
|
|
public static DataTable select(string sql)
|
|
{
|
|
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();
|
|
builder.Server = "80.90.179.235";
|
|
builder.Port = 3306;
|
|
builder.Database = "pozorisp_mihailov";
|
|
builder.UserID = "pozorisp";
|
|
builder.Password = "pozorisp";
|
|
MySqlConnection connect = new MySqlConnection(builder.ConnectionString);
|
|
try
|
|
{
|
|
connect.Open();
|
|
MySqlCommand command = new MySqlCommand(sql, connect);
|
|
MySqlDataReader reader = command.ExecuteReader();
|
|
DataTable table = new DataTable();
|
|
table.Load(reader);
|
|
return table;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
MessageBox.Show($"При запросе произошла ошибка! Код: {e.Message}");
|
|
return null;
|
|
}
|
|
}
|
|
}
|