Last post Dec 01, 2014 08:33 AM by Siva Krishna Macha
Nov 29, 2014 03:21 AM|itismesa|LINK
I have a wcf webservice return a list of objects based on a datareader. The client is requesting not to return list of object but a direct datareader. how can I return a datareader or datatable instead? Provided that my database is Oracle.
Nov 29, 2014 06:03 AM|Siva Krishna Macha|LINK
I would say, your first design holds good, in returning objects - because WCF services serve the purpose of sending objects (importantly messages) over the wire. But if someone is asking to send the DataTable, I believe that is not a good practice because
this is dotnet specific and DataReader is never a good practice because it deals not only with .net specific but also a piece of connected architecture. See:
If, even after the explanation, they want DataTable only, assuming both are using .net framework and they may be internal teams of you - You CAN send the DataTables over the wire, just surround it with your response object.
See this article for step-by-step process
You might also want to take a look at:
Nov 29, 2014 12:15 PM|itismesa|LINK
Thank u Siva
I will give it a try
Dec 01, 2014 08:33 AM|Siva Krishna Macha|LINK