我可以序列数据表或数据集超过在C#中的Web服务转移? [英] Can I serialize a Data Table or Data Set to transfer over a Web Service in C#?
本文介绍了我可以序列数据表或数据集超过在C#中的Web服务转移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是Web服务从表中查询数据。然后,我必须把它发送给谁想要它作为一个DataTable的用户。我可以序列化的数据?或者我应该把它作为一个数据集。我是新来的Web服务,所以我不知道这样做的最佳方式。
解决方案
您可以通过 DataSet.GetXml发送数据从一个数据集的XML字符串()
和比用户可以用 DataSet.ReadXml()
和按 DataSet.Tables
好运
I am using a web service to query data from a table. Then I have to send it to a user who wants it as a DataTable. Can I serialize the data? Or should I send it as A DataSet. I am new to Web Services, so I am not sure the best way to do it.
解决方案
You can send the data as a xml string from a dataset by DataSet.GetXml()
And than the user can deserialize it with DataSet.ReadXml()
And get the datatable from the dataset by DataSet.Tables
Good luck
这篇关于我可以序列数据表或数据集超过在C#中的Web服务转移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文