How can I view the sql statement

Posts   
 
    
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 22-Aug-2006 18:00:39   

vs05 llblgen pro 2 asp.net 2 adapter

I know I can view the statement if an error occurs using the exception. I have a query returning incorrect results and I want to see the sql statement to make adjustments as necessary.

I have a DataSourceObject2 with select parameters base on a gridview datarow key, a field is marked true and another field must be null

select id, name from [table] where id <> @a and active = 1 and pid is null
Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 22-Aug-2006 18:36:33   

debug visualizers and trace enabling can help you with that as indicated in "Generated code - Troubleshooting and debugging"

Another way to get the sql statement is to recompile the ORM source libraries (comment the strong signing in assemblyinfo files) make your project reference the source project, and place a breakpoint in the Query.Command property.