private void formlogin_Load(object sender, EventArgs e) { try { db.condb.Open(); string sqlqery = "SELECT count(*) FROM mattiinventory.tblusers"; MySqlDataAdapter adp = new MySqlDataAdapter(sqlqery, db.condb); DataTable dt = new DataTable(); adp.Fill(dt); if (dt.Rows[0][0].ToString() == "0") { MessageBox.Show("\nThank you for using our software!!\n\nAs for the moment, it seems there\nare no registered account in\nthe system.\nPlease proceed by creating one\n\n- Developer 😉", "Welcome Note!", MessageBoxButtons.OK, MessageBoxIcon.Information); db.condb.Close(); formaccounts acc = new formaccounts(); acc.ShowDialog(); } else { db.condb.Close(); } } catch (Exception ert) { MessageBox.Show(ert.ToString()); } }
private void btnaccount_Click(object sender, EventArgs e) { formaccounts fa = new formaccounts(); fa.ShowDialog(); }