Exemplo n.º 1
0
        private void LoadSinhVienToControl()
        {
            dataGridView1.Rows.Clear();
            XmlDocument       XmlSinhVien_View = SinhvienDBMng.GetDanhsachSinvien();
            XPathNavigator    nav   = XmlSinhVien_View.CreateNavigator();
            XPathNodeIterator nodes = nav.Select("//HEADER");
            int i = 0;

            foreach (XPathNavigator v in nodes)
            {
                dataGridView1.Rows.Add();
                dataGridView1.Rows[i].Cells["SinhvienPrKID"].Value = v.SelectSingleNode("@SinhvienPrkID").Value.ToString();
                dataGridView1.Rows[i].Cells["SinhvienID"].Value    = v.SelectSingleNode("@SinhvienID").Value.ToString();
                dataGridView1.Rows[i].Cells["SinhvienName"].Value  = v.SelectSingleNode("@SinhvienName").Value.ToString();
                dataGridView1.Rows[i].Cells["SinhvienAddr"].Value  = v.SelectSingleNode("@SinhvienAddr").Value.ToString();
                ++i;
            }
        }
Exemplo n.º 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     SinhvienDBMng.Xoasinhvien(getxmlDoc());
     LoadSinhVienToControl();
 }