How do I convert an XLS document to XML in C#?

淺唱寂寞╮ 提交于 2019-11-28 06:13:32

问题


I have an Excel spreadsheet that looks like:

spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg

I'd like to convert this to some XML that looks like:

<UserName>
bla1
</UserName>
<Mail>
bla1[at]bla2.com
</Mail>
<Address>
World
</Address>

can anyone help me do this in C#?


回答1:


Take a look at this Google result:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/b6e8a28c-6760-4e86-a1aa-e2ce9ec36380

Read the Excel file into a DataTable and use DataTable.WriteXml().




回答2:


try File | Save As, filetype .xml



来源:https://stackoverflow.com/questions/2401957/how-do-i-convert-an-xls-document-to-xml-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!