private void 查看绑定ToolStripMenuItem_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(login.sqlName); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "new_教师知识_查绑定表_按知识"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("zhishiID", SqlDbType.Int).Value = treeView1.SelectedNode.Tag; dt绑定表 = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt绑定表); da.Dispose(); 知识点_查看绑定 nf = new 知识点_查看绑定(); nf.Show(); }
private void 查看绑定ToolStripMenuItem2_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(login.sqlName); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "new_教师知识_查绑定表_按题目"; cmd.CommandType = CommandType.StoredProcedure; int i = (int)dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["id"].Value; cmd.Parameters.Add("timuID", SqlDbType.Int).Value = i; dt绑定表 = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt绑定表); da.Dispose(); 知识点_查看绑定 nf = new 知识点_查看绑定(); nf.Show(); }