What should be returned from web service instead of datatable?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 12:39:13

问题


I have created a web service in which i need to return multiple records from a function. For that I used datatable, but found that as it cannot be serialized. So we can't use it. So I used dataset instead of datatable. My service is going to be used in PHP. I am not sure that they (PHP developers) will be able to get data from my dataset (returned from my webservice's function) or not.

Please suggest me what I should return. Dataset or is there any other better option available?

Thanks.


回答1:


I would create a serializable class that can represent each record in the data set and then return a collection of that.




回答2:


Use a cross-platform dataformat like XML or JSON that both worlds (PHP & C#) understand.



来源:https://stackoverflow.com/questions/4519603/what-should-be-returned-from-web-service-instead-of-datatable

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