如何将Xml数据绑定到数据GridView [英] How to bind Xml data to the data GridView

查看:89
本文介绍了如何将Xml数据绑定到数据GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有从Web服务获取的xml数据。现在我想过滤掉并绑定到数据Gridview。例如



Let say i have this xml data that pull from web service. Now i wanted to Filter out and bind into the data Gridview. For Example

<row num="1"> <system_id>SSLM041</system_id><equipment_id>24071</equipment_id>                <serial_no>US40230159</serial_no></row>   <br />
<br />
<row num="2">  <system_id>SSLM041</system_id><equipment_id>PA8394</equipment_id>                <serial_no>MY44061699</serial_no></row>







这是两个示例数据只有它会更多,有人帮我吗?




This is two example data only it will more than that, anyone help me pls?

推荐答案

你好,



你可以转换将XML数据转换为数据表并从该数据表中,您可以轻松地分配数据网格。



希望这会让您领导解决问题。对于XML到DataTable,您可以从谷歌获取代码。您需要注意的唯一事项是您应该从XML数据中选择适合您的DataTable的元素。



谢谢,

Sisir Patro
Hi,

You can convert the XML data into a datatable and from that datatable you can able to get your datagridview assigned easily.

Hope this will give you a lead to get your problem solved. For XML to DataTable you can get the code from google. The only thing you need to take care is you should select the proper element for your DataTable to be filled from the XML data.

Thanks,
Sisir Patro


这篇关于如何将Xml数据绑定到数据GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆