oc A

oc A

  • NA
  • 30
  • 0

Select Nodes from XML File

Jul 19 2008 5:41 AM

Hai all

i am doing a VB.NET windows application . In that i am using an xml file having the following format

<?xml version="1.0" encoding="utf-8"?>

<CardDetRoot>

           <CardDet>

                           <CardCode>CC1</CardCode>

                           <OrgCode>O1</OrgCode>

                           <CardName>O1CC1</CardName>

                            <CardType>SAM</CardType>

                            <MemSize>4K</MemSize>

           </CardDet>

           <CardDet>

                            <CardCode>CC2</CardCode>

                           <OrgCode>O2</OrgCode>

                             <CardName>O2CC2</CardName>

                             <Card Type>USER</CardType>

                          <MemSize>4K</MemSize>

                </CardDet>

               <CardDet>

                            <CardCode>CC3</CardCode>

                            <OrgCode>O2</OrgCode>

                            <CardName>O2CC3</CardName>

                           <CardType>USER</CardType>

                             <MemSize>4K</MemSize>

              </CardDet>

              <CardDet>

                      <CardCode>CC4</CardCode>

                       <OrgCode>O1</OrgCode>

                      <CardName>O1CC4</CardName>

                      <CardType>USER</CardType>

                      <MemSize>8K</MemSize>

             </CardDet>

</CardDetRoot>

 

Here what i want to do is i want to select distinct OrgCode ie. O1  and O2.

Then for each OrgCode i want to select CardCode, CardName, CardType and MemSize.

Then Bind each OrgCode Details to different DataGrid.

That is for O1 there are 2 records

 Record 1 : CardCode = CC1, CardName = O1CC1, CardType = SAM , MemSize = 4K

 Record 2 : CardCode = CC4, CardName = O1CC4, CardType = USER, MemSize = 8K

I want to show there 2 records in one datagrid with datagrid heading as O1. 

Similarly for O2 there are 2 records

Record 1 : CardCode = CC2, CardName = O2CC2, CardType = USER , MemSize = 4K

Record 2 : CardCode = CC3, CardName = O2CC3, CardType = USER, MemSize = 4K

I want to show there 2 records in one datagrid with datagrid heading as O2. 

How i can do this .. Anybody knows ? Any help appreciated .

Thanks in Advance

 

 


Answers (1)