private void entr() { try { //MySqlConnection con = new MySqlConnection("host=" + Host + ";user="******";password="******";database=dsddata;"); //MySqlConnection con = new MySqlConnection("server=192.168.1.2;user id=root;password=;database=dsddata;persistsecurityinfo=True"); MySqlConnection con = new MySqlConnection("server=" + Host + ";user id=" + UserName + ";password="******";database=" + DataBase + ""); string sqll = " Select Count(*),Value From dsddata.login where USERname = '******' and password = '******'"; MySqlCommand cmd = new MySqlCommand(sqll, con); con.Open(); MySqlDataReader reader = cmd.ExecuteReader(); reader.Read(); if (reader["Count(*)"].ToString() == "1") { this.Hide(); Main form1 = new Main(reader["Value"].ToString()); form1.Show(); } else { MessageBox.Show("user name or password error"); } con.Close(); } catch (MySqlException ex) { ConfigrationMysql ccm = new ConfigrationMysql(); MessageBox.Show(ex.Message); ccm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ribbonButton30_Click(object sender, EventArgs e) { ConfigrationMysql cm = new ConfigrationMysql(); cm.Show(); }