Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# 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 27-Mar-13 21:57pm
Comments
Sergey Alexandrovich Kryukov at 28-Mar-13 3:15am
   
Please don't shout.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.  
  3. 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[^].
  4.  
  5. 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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

http://msdn.microsoft.com/en-us/library/cc189056(v=vs.95).aspx
 
Go through the above link
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Afzaal Ahmad Zeeshan 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 28 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100