0

So, I have XML:

<VOLNEMISTO uid="123321123321" celkemVm="1" zmena="10.4.1252" jakKontaktovat="1" autor="1" vyraditDne="2017-12-16">
    <PROFESE kod="698574" nazev="this is name job" doplnek="job job job"/>
    <FIRMA nazev="what name" ic="651111"/>
    <PRACPRAVNI_VZTAH ppvztahPpPlny="A" ppvztahPpZkrac="N" ppvztahSp="N" ppvztahDpp="N" ppvztahDpc="N"/>
    <KONOS jmeno="Renata" prijmeni="Prijmeni" email="email@email.com" adresa="adress">Renata Prijmeni</KONOS>
    <POZNAMKA>NOTES GOES THERE</POZNAMKA>
</VOLNEMISTO>

and I need to create excel file, where it automaticly export "uid" + "FIRMA" + "email" to table.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • 1
    Hello, and welcome to stackoverflow. You wrote, *I tried it many times and every time I failed.* If you share what you tried that did not work, you're more likely to get an answer. When asking a question, we request that you **try** to write the code yourself. After [doing some research](https://meta.stackoverflow.com/questions/261592) if you still have a problem you can **post what you've tried** with a **clear explanation of what isn't working** and provide a [mcve]. I suggest reading [ask] and http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/. – dbc Oct 01 '17 at 20:28
  • One option would be to create a `DataTable` from your XML. Then, to convert it to Excel, you could try some of the answers from [How to export DataTable to Excel](https://stackoverflow.com/q/8207869), [Writing to excel using OleDb](https://stackoverflow.com/q/12807362) and [Insert DataTable into Excel Using Microsoft Access Database Engine via OleDb](https://stackoverflow.com/q/10591600). – dbc Oct 01 '17 at 20:37
  • But there are many other options also. Simply searching for [c# export XML to excel inurl:stackoverflow.com](https://encrypted.google.com/search?q=c%23+export+XML+to+excel+inurl%3Astackoverflow.com) returns [How to convert xml to excel file programmatically](https://stackoverflow.com/q/2494967) and [Export DataTable to Excel File](https://stackoverflow.com/q/1746701) and [C# .xml to .xlsx how?](https://stackoverflow.com/q/17649886). – dbc Oct 01 '17 at 20:40
  • More notes on quality of question: phrases like "searched a lot", "tried a lot" are not considered as "showing research". Question need to be more specific than "help me"/"give hints". "Thank you" text does not belong to SO posts (I've removed all of the above from your post, make sure to edit it with information @dbc linked you to) – Alexei Levenkov Oct 01 '17 at 20:41

0 Answers0