private void 添加成绩信息ToolStripMenuItem_Click(object sender, EventArgs e) { this.Visible = true; // m_connection.Close(); 添加学生成绩窗口 ScanForm = new 添加学生成绩窗口(); DialogResult re = ScanForm.ShowDialog(); }
/// <summary> /// 添加 按钮 触发事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click_1(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"); da.Fill(ds, "s"); //dataGridView1.AutoGenerateColums = ture; dataGridView1.DataSource = ds; dataGridView1.DataMember = "s"; } }