Print Page | Close Window

Is there a way to see the generated SQL?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2012
Printed Date: 29-Jul-2026 at 4:17am


Topic: Is there a way to see the generated SQL?
Posted By: akukucka
Subject: Is there a way to see the generated SQL?
Date Posted: 27-Jul-2010 at 1:03pm
Hello I was wondering if there is a way to get the generated SQL for logging/debugging purposes. I know there's a way in EF but I haven't been able to find anything for DF.

Thanks!



Replies:
Posted By: davidklitzke
Date Posted: 27-Jul-2010 at 3:48pm

You can set the logTraceString to true on the edmKey and the generated sql will be written to the debuglog.



Posted By: akukucka
Date Posted: 28-Jul-2010 at 7:17am
That's just what I needed - thanks!


Posted By: hueha
Date Posted: 18-Sep-2010 at 8:34am
Originally posted by davidklitzke

You can set the logTraceString to true on the edmKey and the generated sql will be written to the debuglog.


I can't seem to get this working.  I have a silverlight project running devforce 6.0.5.  I ran the configuration editor against the web.config and made sure the LogTraceString checkbox was checked.  Connection string was set to the database.  I ran the traceviewer but all i get from that  is the following 


Error connecting to net.tcp://localhost:9922/TracePublisher. Error: Could not connect to net.tcp://localhost:9922/TracePublisher. The connection attempt lasted for a time span of 00:00:02.0280035. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:9922. 

I also checked the debuglog.xml and nothing special appears in there.



Posted By: sbelini
Date Posted: 21-Sep-2010 at 10:22am
 
Any chance this port is blocked and/or already being used?
Besides the SQL statements, does the debuglog.xml seem to be populated properly? (doublecheck timestamps)
 
 
 


Posted By: hueha
Date Posted: 27-Sep-2010 at 12:29am
I don't think the port is being used.  I dropped the firewall just in case.  I couldn't get the trace happening but I can get sql to appear in debuglog.xml now which is all I really need (I had to explicitly put my connection name rather than just use default).  However, I can only see the fetches.  I can't see any update statements


Posted By: mikewishart
Date Posted: 28-Sep-2010 at 10:51am
I was curious about this and tried this with no luck:

  <ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">
    <logging logFile="DebugLog.xml" />
    <objectServer remoteBaseURL="http://localhost" serverPort="9009" serviceName="EntityService.svc" >
      <clientSettings isDistributed="true" />
    </objectServer>  
    <edmKeys>
      <edmKey name="App" connection="..." logTraceString="true" />
      <edmKey name="Global" connection="..." logTraceString="true" />
    </edmKeys>



Posted By: sbelini
Date Posted: 28-Sep-2010 at 11:23am
hueha,
 
Are you publishing to the TraceViewer? Otherwise you will only be able to see the debuglog.xml
You need to publish by using: (in Global.asax if Silverlight)
 
IdeaBlade.Core.TracePublisher.LocalInstance.MakeRemotable();
 
You can find detailed information in the API Documentation. Also, you can find some samples using TraceViewer in our http://drc.ideablade.com/xwiki/bin/view/Documentation/Code_MiniDemosSilverlight_BusObjPersistence - DevForce Resource Center .
 
As for not seing update statements, that's because DevForce publishes only what's made available by the Entity Framework.
You can still see all SQL statements by checking the SQL Server Profiler (in the SQL Server Management Studio go to Tools>>SQL Server Profiler).


Posted By: sbelini
Date Posted: 28-Sep-2010 at 2:56pm
Hi Mike,
 
You mention you tried with no luck.
By that you mean not getting the SQL inside debuglog.xml or in the TraceViewer?
 
As I mentioned previously, you need to publish the tracing messages in order to see them in the TraceViewer.


Posted By: hueha
Date Posted: 28-Sep-2010 at 10:08pm
Unfortunately I'm using sql express at the moment which doesn't come with a profiler



Print Page | Close Window