private void 添加课程信息ToolStripMenuItem_Click(object sender, EventArgs e) { this.Visible = true; // m_connection.Close(); 添加课程信息窗口 ScanForm = new 添加课程信息窗口(); DialogResult re = ScanForm.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { FormAddN = new 添加课程信息窗口(); DialogResult re = FormAddN.ShowDialog(); //如果添加了学籍信息,更新浏览学籍信息界面 if (DialogResult.OK == re) { SqlDataAdapter da = new SqlDataAdapter(stuText, m_connection); DataSet ds = new DataSet("s"); //创建dataset对象,调用指定数据集名称的构造函数 da.Fill(ds, "stable"); //使用SqlDataAdapter对象的fill方法填充数据集,填充到“stable“表 //dataGridView1.AutoGenerateColums = ture; //dataGridview控件绑定数据源 dataGridView1.DataSource = ds; dataGridView1.DataMember = "stable"; } }