private void goodsFrame_Load(object sender, EventArgs e) { string constring = "datasource=localhost;port=3306;username=root;password=1234"; MySqlConnection conDataBase = new MySqlConnection(constring); MySqlCommand auth = new MySqlCommand("SELECT * FROM sporthit.сотрудники WHERE логин_сотрудника = '" + Convert.ToString("admin") + "' AND пароль = '" + Convert.ToString("1234") + "'",conDataBase); conDataBase.Open(); MySqlDataReader rd = auth.ExecuteReader(); //rd.Read(); try { //auth.ExecuteNonQuery(); // if (rd.Read()) { MessageBox.Show(String.Format("Login: {0}, Password: {1}", rd.GetString("логин_сотрудника")), rd.GetString("пароль")); } else { MessageBox.Show("Неправильный логин или пароль!", "Ошибка авторизации"); } rd.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } add.BackgroundImage = Properties.Resources.addButton; remove.BackgroundImage = Properties.Resources.removeButton; } It is necessary to select from the database a line with the name admin and password 1234, I don’t really understand programming, I count on your help, thank you in advance!