Recently, when I was studying WCF and returned to the able, "An error occurred while loading ing the HTTP Response to http: // localhost: 9999/calculatorservice. this cocould be due to the service endpoint binding not using the HTTP protocol. this coshould 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.. After checking for half a day, we found that the original returned able did not assign a value to tablename.
Code
Public System. Data. datatable getdatatable ()
{
Datatable mydt = New Datatable ();
Mydt. Columns. Add ( " Userid " , Typeof ( Int ));
Mydt. Columns. Add ( " Username " , Typeof ( String ));
Mydt. Columns. Add ( " Birthday " , Typeof (Datetime ));
For ( Int I = 0 ; I < 300 ; I ++ )
{
Datarow Dr = Mydt. newrow ();
Dr [ " Userid " ] = I + 1 ;
Dr [ " Username " ] = "Xx " + I;
Dr [ " Birthday " ] = Datetime. now;
Mydt. Rows. Add (DR );
}
Return Mydt;
}
Then add mydt. tablename = "mydt.