如何读取XML并在gridview中显示 [英] How to read XML and display in gridview

查看:57
本文介绍了如何读取XML并在gridview中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Below is my xml i need to read this xml and display in gridview with below columns 

Bnum    Pnum   Vnum    Bdilute   Cdilute   Test   Mcode and the data for that columns should be brought from below xml 

For Bnum we need to get SID from view1 tag of xml
For Pnum we need to get IDPa from view2 tag of xml
For Vnum we need to get ID from Act1 tag of xml
For Bdilute we need to get TrDate from view1 tag of xml
For Cdilute we need to get Code from Act1,Act2 and Act3 tag of xml
For Test we need to get Type from Dial1 tag of xml
For Mcode we need to get Co from Dial1 tag of xml







-<view>

<view1>

<SID>MOH-F-1000076</SID>  --required

<RID>TPA001</RID>

<TrDate>13/03/2018 08:42</TrDate>  --required

</view1>


-<view2>

<ID>IP0000012694</ID>

<IDPa>5653584</IDPa>  --required

<MeID>02293010185</MeID>


-<count>

<FID>MOH-F-1000076</FID>

<Start>01/08/2017 00:09</Start>

<End>02/08/2017 19:48</End>

</count>


-<Dial1>

<Type>Principal</Type>  --required

<Co>K35.80</Co> --required

</Dial1>


-<Dail2>

<Type>Secondary</Type>  --required

<Co>R10.9</Co>  --required
 
</Dail2>


-<Dial3>

<Type>Secondary</Type>  --required

<Code>R11.0</Code>  --required

</Dial3>


-<Dial4>

<Type>Secondary</Type>  --required
 
<Code>R63.8</Code>  --required

</Dial4>


-<Dial5>

<Type>Secondary</Type>   --required

<Code>R79.89</Code>  --required

</Dial5>


-<Dial6>

<Type>Secondary</Type>  --required

<Code>Z01.812</Code>  --required

</Dial6>


-<Dial7>

<Type>Secondary</Type>  --required

<Code>Z01.83</Code>  --required

</Dial7>


-<Act1>

<ID>1</ID>    --required

<Code>36000</Code>  --required


</Act1>


-<Act2>

<ID>2</ID>  --required

<Code>85396</Code>  --required

</Act2>


-<Act3>

<ID>3</ID>  --required

<Code>86900</Code>  --required

</Act3>


</view2>
</view>





我的尝试:



任何人都可以帮助我们,因为我们无法检索它们



What I have tried:

can anyone help us out as we are unable to retrieve them

推荐答案

你看了下面的文章XML Reader

这篇关于如何读取XML并在gridview中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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