Returning DataTables in WCF/.NET

前端 未结 8 1592
广开言路
广开言路 2020-12-01 05:00

I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good pract

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 05:36

    The best way to diagnose these kinds of WCF errors (the ones that really don't tell you much) is to enable tracing. In your web.config file, add the following:

      
        
          
            
              
            
          
        
      
    

    You can then open the resulting file in the SvcTraceViewer.exe utility which comes in the .NET Framework SDK (or with Visual Studio). On my machine, it can be found at %PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\Bin\SvcTraceViewer.exe.

    Just look for an error message (in bold red) and that will tell you specifically what your problem is.

提交回复
热议问题