是否在DATAGRIDVIEW中获取XMLDocument? [英] Fetch XMLDocument in DATAGRIDVIEW......?
问题描述
大家好,
我遇到了一个问题,无法在datagridview中显示我的XML文档.
例如我的XML文件如下:
< EmployeeDetail>
< EmployeeID>
< EmpId> 101</EmpId>
< EmpId> 202</EmpId>
< EmployeeID>
< EmployeeName>
< EmpName> Jai</EmpName>
< EmpName> Anurag</EmpName>
</EmployeeName>
</EmployeeDetail>
现在这些EmpID和EmployeeName希望出现在DataGridView中.
请帮帮我..............
Hi Guys,
I am facing a problem to show my XML document in datagridview.
for example my XML file is like:
<EmployeeDetail>
<EmployeeID>
<EmpId>101</EmpId>
<EmpId>202</EmpId>
<EmployeeID>
<EmployeeName>
<EmpName>Jai</EmpName>
<EmpName>Anurag</EmpName>
</EmployeeName>
</EmployeeDetail>
now these EmpID and EmployeeName wanted to appear in DataGridView.
Please help me out..............
推荐答案
您的基本问题是您的XML格式很烂.我希望使用一种定义对象的格式,以便每个Employee组都有一个Id和Name,然后希望它们成为您的datagrid中的列.就目前而言,您没有一种有意义的格式,在现实世界中通常没有用,也没有映射为网格格式.如果您将XML修改为符合逻辑的文件,那么我看不出您无法在网络上查看将XML用作数据源并将其与您的格式匹配的示例的任何原因.
Your basic problem is that your XML format sucks. I''d expect a format that defines objects, so that each Employee group has an Id and Name, which I''d then expect to be columns in your datagrid. As it stands, you don''t have a format that makes sense, is generally useful in the real world, or maps to a grid format. If you fix your XML to be logical, then I don''t see any reason why you couldn''t look at examples on the web for using XML as a data source, and match it to your format.
这篇关于是否在DATAGRIDVIEW中获取XMLDocument?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!