private void Button7_Click(object sender, EventArgs e) { ActiveForm.Hide(); ListofCharities reg = new ListofCharities(); reg.ShowDialog(); Close(); }
public ListofCharities() { InitializeComponent(); SqlConnection scc = new SqlConnection(); ListofCharities loc = this; scc.ListOfCharReader(loc); timer1.Start(); }
public void ListOfCharReader(ListofCharities loc) { string connStr = "Server=localhost;user=root;database=ketrar;password="******"SELECT CharityLogo, CharityName, CharityDescription FROM charity"; MySqlCommand command = new MySqlCommand(sql, conn); MySqlDataReader reader = command.ExecuteReader(); int i = 0; while (reader.Read()) { loc.imgAdd(reader[0].ToString(), reader[1].ToString() + ":" + reader[2].ToString()); i++; } reader.Close(); conn.Close(); }