从xml检索数据 [英] retrieve the datas from xml
本文介绍了从xml检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从XML检索数据并将其显示在gridview中,对此的解决方案是什么.从这个XML文件中.
<? xml version = " encoding = " < EmpolyeeDetails >
< 员工 =" 001" < 名称 > Admin < /名称 >
< 名称 > SalesMan < /名称 >
< 电话 > 343434 < /Phone >
< 地址 > xxxxxxx < /地址 >
< 密码 > temp @ 123 < /Password >
< /Employee >
< 员工 =" 002" < 名称 > Kamal < /名称 >
< 名称 > 6546565 < /名称 >
< 电话 > SalesMan < /Phone >
< 地址 > testing < /地址 >
< 密码 > temp @ 123 < /Password >
< /Employee >
< /EmpolyeeDetails >
解决方案
昨天问了同样的问题:
从xml检索数据 [ http://www.shabdar. org/c-sharp/120-read-write-xml-data-using-adonet-dataset-and-c.html [ XmlDataSource类 [ ^ ],用于表示数据绑定控件的XML数据源.XmlDataSource控件通常用于在只读方案中显示分层XML数据.
看看有 [<?xml version="1.0" encoding="utf-8"?> <EmpolyeeDetails> <Employee EmpId="001"> <Name>Admin</Name> <Designation>SalesMan</Designation> <Phone>343434</Phone> <Address>xxxxxxx</Address> <Password>temp@123</Password> </Employee> <Employee EmpId="002"> <Name>Kamal</Name> <Designation>6546565</Designation> <Phone>SalesMan</Phone> <Address>testing</Address> <Password>temp@123</Password> </Employee> </EmpolyeeDetails>解决方案This very same question was asked yesterday :
retrieving datas from xml[^]
Cheers
refer this
http://www.shabdar.org/c-sharp/120-read-write-xml-data-using-adonet-dataset-and-c.html[^]
you can use XmlDataSource Class[^] which is used to represents an XML data source to data-bound controls.The XmlDataSource control is typically used to display hierarchical XML data in read-only scenarios.
Have a look there[^] for learn binding solution of Controls to XML Data.
这篇关于从xml检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文