开发者

passing class or datareader via webservice

I have a broad question about Web Serv开发者_JS百科ices and SOA. I have a database that contains data I would like to expose for reading (just reading, no inserts or updates). Is it best to expose the data as a class or is it best to expose the information as a datareader?


You can't expose data reader over web service. You have to execute reader, fill data to objects and send those objects.

Check WCF Data services. It will save you a lot of work.


I think the DataReader is not serializable. It's better to return the result as list of objects or you may fill a DataTable and return it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜