Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Programming » .NET application programming » SQL Anywhere .NET Data Provider » .NET tracing support


Configuring a Windows application for tracing

Enabling tracing on the TableViewer sample application involves creating a configuration file that references the ConsoleTraceListener and TextWriterTraceListener listeners, removes the default listener, and enables all switches that would otherwise be set to 0.


You must have Visual Studio installed.

Context and remarks

Windows Mobile does not support tracing.

  1. Open the TableViewer sample in Visual Studio.

    Start Visual Studio and open the %SQLANYSAMP16%\SQLAnywhere\ADO.NET\TableViewer\TableViewer.sln.

  2. Create an application file named App.config and copy the following configuration setup:

    <?xml version="1.0" encoding="utf-8" ?>
     <source name="iAnywhere.Data.SQLAnywhere" 
       <add name="ConsoleListener" 
       <add name="TraceLogListener" 
            traceOutputOptions="ProcessId, ThreadId, Timestamp"/>
       <remove name="Default"/>
     <add name="SASourceSwitch" value="All"/>
     <add name="SATraceAllSwitch" value="1" />
     <add name="SATraceExceptionSwitch" value="1" />
     <add name="SATraceFunctionSwitch" value="1" />
     <add name="SATracePoolingSwitch" value="1" />
     <add name="SATracePropertySwitch" value="1" />
  3. Rebuild the application.

  4. Click Debug » Start Debugging.


When the application finishes execution, the trace output is recorded in the bin\Debug\myTrace.log file.


View the trace log in the Output window of Visual Studio.

 See also