Передача XML в datagridview C#
Как я могу передать следующий XML-файл в представление datagrid
<root type="object"> <gstin type="string">24AB3584G1ZL</gstin> <fp type="string">082017</fp> <b2b type="array"> <item type="object"> <ctin type="string">24AC7232H1ZR</ctin> <cfs type="string">Y</cfs> <cname type="null"></cname> <inv type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">1476.75</samt> <rt type="number">5</rt> <txval type="number">59070</txval> <camt type="number">1476.75</camt> </itm_det> </item> </itms> <val type="number">62024</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">12-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">217/G</inum> <chksum type="string">fb9401722f9f9f46cfa8ddf70647ebd47a3ca1094f4c6a17e874aea79296dcb8</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">1408.38</samt> <rt type="number">5</rt> <txval type="number">56335</txval> <camt type="number">1408.38</camt> </itm_det> </item> </itms> <val type="number">59152</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">12-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">218/G</inum> <chksum type="string">d06e30bc81f3ea8f83b735104967f878119a635dd898b33e954f41d87ebacc8c</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">1393.5</samt> <rt type="number">5</rt> <txval type="number">55740</txval> <camt type="number">1393.5</camt> </itm_det> </item> </itms> <val type="number">58527</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">16-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">222/G</inum> <chksum type="string">1a5e45053bf0665455557ea3df6b0d4d170c595b646ed54d52ef561bb66bdf77</chksum> </item> </inv> </item> <item type="object"> <ctin type="string">24AA3022L1ZJ</ctin> <cfs type="string">Y</cfs> <cname type="null"></cname> <inv type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">1</num> <itm_det type="object"> <csamt type="number">0</csamt> <samt type="number">1240.7</samt> <rt type="number">5</rt> <txval type="number">49628</txval> <camt type="number">1240.7</camt> </itm_det> </item> </itms> <val type="number">52109</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">27-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">13/119</inum> <chksum type="string">5951d10d389e1b6d9f6b88c536b5fc5f3676b9dd15d977a3fbe741407bd3796f</chksum> </item> </inv> </item> <item type="object"> <ctin type="string">24AI654J1ZX</ctin> <cfs type="string">Y</cfs> <cname type="null"></cname> <inv type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">1</num> <itm_det type="object"> <csamt type="number">0</csamt> <samt type="number">1263.83</samt> <rt type="number">5</rt> <txval type="number">50553</txval> <camt type="number">1263.83</camt> <iamt type="number">0</iamt> </itm_det> </item> </itms> <val type="number">53080.65</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">23-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">149</inum> <chksum type="string">ed7e5e187ea6349faff81f7e2eb2910a87ec4df0d70f388aa1ba4b46312032ba</chksum> </item> </inv> </item> <item type="object"> <ctin type="string">24A6274F1ZA</ctin> <cfs type="string">Y</cfs> <cname type="null"></cname> <inv type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">1</num> <itm_det type="object"> <csamt type="number">0</csamt> <samt type="number">748.65</samt> <rt type="number">5</rt> <txval type="number">29946</txval> <camt type="number">748.65</camt> <iamt type="number">0</iamt> </itm_det> </item> </itms> <val type="number">31443</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">01-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">594</inum> <chksum type="string">c3c6c3b9651ded60d8cd58d5659aa99e5f08a50b04e261a647fdd2e55958c03c</chksum> </item> </inv> </item> <item type="object"> <ctin type="string">24AA064Q1ZW</ctin> <cfs type="string">Y</cfs> <cname type="null"></cname> <inv type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">649.45</samt> <rt type="number">5</rt> <txval type="number">25978</txval> <camt type="number">649.45</camt> </itm_det> </item> </itms> <val type="number">27277</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">04-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">5685/J</inum> <chksum type="string">e4809d5e25b7df166fe140851c6d74244807c8de759bfd251cf9f2f06a4fabf5</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">136.8</samt> <rt type="number">5</rt> <txval type="number">5472</txval> <camt type="number">136.8</camt> </itm_det> </item> </itms> <val type="number">5746</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">05-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">5721/J</inum> <chksum type="string">1244f4d49e7a3e50f42bb9b0f87ebd961d4a7d0900c84d5d1feff9788c27b151</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">130.97</samt> <rt type="number">5</rt> <txval type="number">5239</txval> <camt type="number">130.97</camt> </itm_det> </item> </itms> <val type="number">5501</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">05-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">5753/J</inum> <chksum type="string">1eb028428be75cfdc790a0de2f7a9197099166617b46e7a4c9e4a31de17b194f</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">415.8</samt> <rt type="number">5</rt> <txval type="number">16632</txval> <camt type="number">415.8</camt> </itm_det> </item> </itms> <val type="number">17464</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">08-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">5826/J</inum> <chksum type="string">c174a888d8f2ba95c78354ebefcb41d75b37902daf7ca43c2f2b2e022e501dde</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">272.8</samt> <rt type="number">5</rt> <txval type="number">10912</txval> <camt type="number">272.8</camt> </itm_det> </item> </itms> <val type="number">11458</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">09-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">5866/J</inum> <chksum type="string">b1fce912197d109cf4bf19f7b585bbffabe7bcd53772369ce2a2935a0d4162bc</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">429.35</samt> <rt type="number">5</rt> <txval type="number">17174</txval> <camt type="number">429.35</camt> </itm_det> </item> </itms> <val type="number">18033</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">21-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">6437/J</inum> <chksum type="string">3577ce8549a7e8853eb00b0737b2f94352abbbd70f6a12946dc803d4a245895a</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">288.7</samt> <rt type="number">5</rt> <txval type="number">11548</txval> <camt type="number">288.7</camt> </itm_det> </item> </itms> <val type="number">12125</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">22-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">6470/J</inum> <chksum type="string">ef6104e50fceec2e841aaccd2814e522b2c06803fddde53cf2a343e7a551eb32</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">1515.53</samt> <rt type="number">5</rt> <txval type="number">60621</txval> <camt type="number">1515.53</camt> </itm_det> </item> </itms> <val type="number">63652</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">26-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">6796/J</inum> <chksum type="string">8b666418ab813d2030d882e0f18071da91d83adfbe6d7b0ac557d70aad0877ca</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">1360.13</samt> <rt type="number">5</rt> <txval type="number">54405</txval> <camt type="number">1360.13</camt> </itm_det> </item> </itms> <val type="number">57125</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">28-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">6897/J</inum> <chksum type="string">c8fb4ae410a3283c5221e9203167dc1687791a87179850c51a0f15346b317541</chksum> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">342.73</samt> <rt type="number">5</rt> <txval type="number">13709</txval> <camt type="number">342.73</camt> </itm_det> </item> </itms> <val type="number">14394</val> <inv_typ type="string">R</inv_typ> <pos type="string">24</pos> <idt type="string">29-08-2017</idt> <rchrg type="string">N</rchrg> <inum type="string">6931/J</inum> <chksum type="string">07ff8bcde46c86e427a2fa850c58d643f2adc32182ec674091c94f2419a787dd</chksum> </item> </inv> </item> </b2b> <cdn type="array"> <item type="object"> <cfs type="string">Y</cfs> <ctin type="string">24A0064Q1ZW</ctin> <cname type="null"></cname> <nt type="array"> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">59.23</samt> <rt type="number">5</rt> <txval type="number">2369</txval> <camt type="number">59.23</camt> </itm_det> </item> </itms> <val type="number">2487</val> <idt type="string">26-08-2017</idt> <ntty type="string">C</ntty> <nt_num type="string">65</nt_num> <inum type="string">6796/J</inum> <rsn type="string">02-Post Sale Discount</rsn> <nt_dt type="string">31-08-2017</nt_dt> <chksum type="string">ec636db911bbcf11b1aa200c91fe72ee4850e74886530247dc7f54353b912c93</chksum> <p_gst type="string">N</p_gst> </item> <item type="object"> <itms type="array"> <item type="object"> <num type="number">500</num> <itm_det type="object"> <samt type="number">353.98</samt> <rt type="number">5</rt> <txval type="number">14159</txval> <camt type="number">353.98</camt> </itm_det> </item> </itms> <val type="number">14867</val> <idt type="string">28-08-2017</idt> <ntty type="string">C</ntty> <nt_num type="string">74/C</nt_num> <inum type="string">6897/J</inum> <rsn type="string">02-Post Sale Discount</rsn> <nt_dt type="string">31-08-2017</nt_dt> <chksum type="string">4cf679fd864f55bcc9c4eafb039deddeb6df8ed97b495f4023548946c884b39e</chksum> <p_gst type="string">N</p_gst> </item> </nt> </item> </cdn> </root>
Что я уже пробовал:
Я попробовал DataSet.ReadXML, но он не работает, так как существует общая родительская и дочерняя таблицы.
Нужен он именно в таком формате
RequiredOutput.csv - Google Диск[^]