string login textBox1 Text string password textBox2 Text string connec

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
string login=textBox1.Text;
string password=textBox2.Text;
string connection = "datasource=localhost;" + "database=game_base_v2;" + "username=" + login + ";" + "password=" + password;
bool check = false;
using (MySqlConnection con = new MySqlConnection())
{
con.ConnectionString = connection;
try
{
con.Open();
check = true;
}
catch (Exception ex)
{
check = false;
}
con.Close();
}