如何将XML数据从Web服务转换为DataTable [英] How to convert XML data from a webservice to DataTable
本文介绍了如何将XML数据从Web服务转换为DataTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个WCF服务来发布DataTable。可以在XML格式的http:// localhost:1234 / Service1.svc / TableName中查看数据。在我的应用程序中,我使用下面的代码:
I created a WCF service to publish a DataTable. The data can be viewed in http://localhost:1234/Service1.svc/TableName in XML format. In my application, I use the code below:
string url = "http://localhost:48677/Service1.svc/GetDataTable";
var webClient = new System.Net.WebClient();
string data = webClient.DownloadString(url);
如何转换字符串数据进入DataTable?谢谢。
How can the string data be converted into a DataTable? Thanks.
推荐答案
试试这个链接
http://stackoverflow.com/questions/1389513/converting-xml-to-a-datatable [ ^ ]
希望这有助于
Try this link
http://stackoverflow.com/questions/1389513/converting-xml-to-a-datatable[^]
Hope this helps
问题解决了 - 请参阅如何转换和解析数据集[^] 的xml文件[ ^ ]
Problem solved - see How to convert and parse an xml file to Dataset[^][^]
这篇关于如何将XML数据从Web服务转换为DataTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文