Click here to Skip to main content
15,896,480 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
XML
-<SalesOrders>
- <SalesOrder>
  <OrderNo>1001</OrderNo>
  <InvoiceNo>10001</InvoiceNo>
  <CustomerID>b46aa871-b9d4-4ee4-8881-78bb5307b35d</CustomerID>
  <Customer>Numeri Consulting AS</Customer>
  <Created>2011-12-21T11:17:41+01:00</Created>
  <Modified>2011-12-21T11:22:47+01:00</Modified>
- <SalesOrderDetails>
  <LineNo>10</LineNo>
  <ProductID>c1f128ca-0db8-4d79-ac83-0650e558230d</ProductID>
  <Product>100 - Iphone4</Product>
  <Tax>1000.0000</Tax>
  <Amount>4000.0000</Amount>
  </SalesOrderDetails>
- <SalesOrderDetails>
  <LineNo>20</LineNo>
  <ProductID>2f08b82f-828d-4792-a70d-f2ba9fba9f7e</ProductID>
  <Product>1000 - Hodetelefoner</Product>
  <Tax>75.0000</Tax>
  <Amount>300.0000</Amount>
  </SalesOrderDetails>
  </SalesOrder>
  -</SalesOrders>

I HAVE ABOVE XML FOR EACH SALES ORDER I HAVE ONE CUST AND MULTIPLE PRODUCTS HOW TO GET CUSTOMER AND PRODUCT ID AND DO THE OPERATIONN
FOR EXAMPLE CUST ID =b46aa871-b9d4-4ee4-8881-78bb5307b35d AND
PRODUCT ID[0] = c1f128ca-0db8-4d79-ac83-0650e558230d
PRODUCT ID [1] = 2f08b82f-828d-4792-a70d-f2ba9fba9f7e
FOR ONE CUSTOMER HERE THERE IS TWO PRODUCT SO I WOULD LIKE TO INSERT IN DB
Posted
Comments
Sergey Alexandrovich Kryukov 28-Mar-13 3:15am    
Please don't shout.
—SA

There are different approaches fully implemented in .NET FCL. Please see my short overview of them:

  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the class System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].


—SA
 
Share this answer
 
http://msdn.microsoft.com/en-us/library/cc189056(v=vs.95).aspx

Go through the above link
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900