示例#1
0
文件: Form1.cs 项目: o2valente/BD
        private void button3_Click(object sender, EventArgs e)
        {
            TrainerForm tform = new TrainerForm();

            GetTrainers(tform);
            tform.setForm(this);
            tform.ShowDialog();
        }
示例#2
0
文件: Form1.cs 项目: o2valente/BD
        public void GetTrainers(TrainerForm tform)
        {
            CN.Open();
            SqlCommand cmd = new SqlCommand("PROJETO.GetTreinadores", CN);

            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataReader reader = cmd.ExecuteReader();

            tform.GetListBox().Items.Clear();
            while (reader.Read())
            {
                tform.GetListBox().Items.Add(reader["Nome"] + " | " + " " + reader["Clube"] + " | " + reader["Especializacao"]);
            }
            CN.Close();
        }