示例#1
0
        private void button6_Click(object sender, EventArgs e)
        {
            ActiveForm.Hide();
            ListOfChar loc = new ListOfChar();

            loc.ShowDialog();
            Close();
        }
        public void ListOfCharReader(ListOfChar loc)
        {
            string          connStr = "server=localhost;user=root;database=pafenov;password="******"SELECT CharityLogo, CharityDescription, CharityName FROM charity";
            MySqlCommand    command = new MySqlCommand(sql, conn);
            MySqlDataReader reader  = command.ExecuteReader();

            while (reader.Read())
            {
                loc.imgAdd(reader[0].ToString(), reader[2].ToString() + ": " + reader[1].ToString());
            }
            reader.Close();
            conn.Close();
        }
        //public List<string> ls;
        public ListOfChar()
        {
            InitializeComponent();
            tm.Tick    += timer1_Tick;
            tm.Interval = 1000;
            tm.Enabled  = true;
            tm.Start();
            SqlConnClass scc = new SqlConnClass();
            //dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            //dataGridView1.AllowUserToAddRows = false;
            ListOfChar loc = this;



            scc.ListOfCharReader(loc);

            //ls = scc.listLs();
            //imgAdd();
        }