I have a multilevel xml that i receive from queues. I need to break each level and put into database. Below is the example:
<?xml version="1.0" encoding="utf-16"?>
<Request>
<transactionID>3</transactionID>
<units>
<Number>001</serialNumber>
<Id>222</instanceId>
<fNumber>765</routeNumber>
<status>open</status>
<Message>Error</errorMessage>
</units>
<units>
<Number>009</serialNumber>
<Id>675</instanceId>
<fNumber>765</routeNumber>
<status>Close</status>
<Message>mesage</errorMessage>
</units>
</Request>
I tried using ds.ReadXML... i开发者_运维问答t only takes units beceause i give datamember property of datagrid to units
i need to put units into different table and transaction id also.. Pls help.
If
You can use Linq to XML to navigate through the XML and break it down or you might Deserialize the XML into a C# object Have a look at
Deserializing XML to Objects in C#
精彩评论