Any way to populate items from xml to Datagridview using c#

后端 未结 3 1956
走了就别回头了
走了就别回头了 2020-12-21 05:49

I\'m working on the datagridview. In which i have to show the values of the column from the xml to the grid view column. I have xml like this:- Also i have a grid view which

3条回答
  •  Happy的楠姐
    2020-12-21 06:16

    C#
        DataSet ds = new DataSet();
        ds.ReadXml("C:/XMLData/employee.xml");
        DataGridView1.DataSource = ds.Tables(0);
    
    
    VB.NET
        Dim ds As New DataSet
        ds.ReadXml("C:/XMLData/employee.xml")
        DataGridView1.DataSource = ds.Tables(0)
    

提交回复
热议问题