I am using DataTable
in my WCF application, but was getting an error. This is how I fixed the error.
When returning a DataTable from a web service in WCF to windows form application. I was getting this exception.
System.ServiceModel.CommunicationException: 'An error occurred while receiving the HTTP response to http://localhost:52968/MunerahService1.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.'
It happened any time I tried to retrieve a DataTable
To fix the exception I needed to give the DataTable
a name.
code with the error
tab = new DataTable();
Fixed code to remove the excption
tab = new DataTable("Doctor_info");