开发者

passing class or datareader via webservice

开发者 https://www.devze.com 2023-02-05 02:11 出处:网络
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 d

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

精彩评论

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