How to view the generated SQL?

Posts   
 
    
mikevanoo
User
Posts: 18
Joined: 18-Feb-2004
# Posted on: 18-Feb-2004 12:51:47   

I've had a look through the docs and the forums but couldn't find anything on this. Is it possible to view the generated SQL?

Thanks,

Mike.

bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 18-Feb-2004 13:47:24   

Tye using the SQL profiler if you are using MS SQL Server.

mikevanoo
User
Posts: 18
Joined: 18-Feb-2004
# Posted on: 19-Feb-2004 17:57:29   

Thats what I have been doing but I always find it a little cumbersome, particularly when it just seems to ignore the DatabaseName filter I setup and spurts out SQL for all of the databases on the machine.

I was hoping there was something in the generated code - a method to call, a property to write out?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Feb-2004 18:09:33   

mikevanoo wrote:

Thats what I have been doing but I always find it a little cumbersome, particularly when it just seems to ignore the DatabaseName filter I setup and spurts out SQL for all of the databases on the machine.

I was hoping there was something in the generated code - a method to call, a property to write out?

You can step into the code if you want.

What templates are you using (Selfservicing or adapter) and which language? (VB.NET or C#)

Frans Bouma | Lead developer LLBLGen Pro
bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 19-Feb-2004 18:10:16   

mikevanoo wrote:

seems to ignore the DatabaseName filter I setup and spurts out SQL for all of the databases on the machine.

Yeah some of the profiler doesnt work jsut right. What I do is get tha database ID

select * from sysdatabases

And Filter On the ID.... that works

Bert

mikevanoo
User
Posts: 18
Joined: 18-Feb-2004
# Posted on: 20-Feb-2004 09:40:16   

I'll try the database ID way. Thanks Bert.

I'm using the adapter template in C#. I'm using NUnit to test the code at the minute and can step through the code OK (once I worked out where to put the .config file) - I'll just step through a little deeper than I have been doing.

Thanks,

Mike.

jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 16-Aug-2005 12:27:19   

If you add the following to your web config, the Generated SQL will print to the output window while debugging:

<system.diagnostics> <switches> <add name="SqlServerDQE" value="4" /> </switches> </system.diagnostics>

NB - this will only work for Sql Server. The name of the Switch will have to be changed as required for other databases.

This feature is based on enabling .NET TraceSwitches built in to the LLBLGen code. See the following link for more info:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticstraceswitchclasstopic.asp

Banane avatar
Banane
User
Posts: 67
Joined: 01-Sep-2004
# Posted on: 03-Apr-2006 21:40:36   

where can I get the generated sql?

I'm using selfservicing...and dynamic typed list.... I cannot find it

it is failling into GetMultiAsDataTable and I don't know why so I want to print the sql somewhere....

thanks

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 04-Apr-2006 02:29:35   

By default, you can view the SQL Trace info by looking in the Output Window of Visual Studio when you have enabled the trace switch mentioned by jsballard.

There are other types of trace listeners that can be used, and they are not specific to LLBLGen. A Google search will turn up several methods.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Apr-2006 07:51:23   

Please refer to "Using the generated code -> Troubleshooting and debugging" in the LLBLGen Pro documentation

Banane avatar
Banane
User
Posts: 67
Joined: 01-Sep-2004
# Posted on: 04-Apr-2006 15:45:59   

sorry I'm working with Oracle 8-9i !! thanks Walaa it works