An easy way to see the SQL generated by ActiveRecord.Save ()?

SubSonic 2.1

I have an ActiveRecord object. When I call its Save () method, is there an easy way to see the generated SQL in, say, the Visual Studio debugger? Running SQL Profiler is not an option.

Thanks.

0


a source to share


1 answer


You can load the subsonic source project into visual studio and set the main project debug target for your application and start the debugger. Or you can attach a debugger to your running application. Your application should be built with reference to the current debug output of the "subsonic.dll" subsonic project; I usually have both projects open in separate instances of visual studio. Then set a breakpoint relative to line 180 of activerecord.cs:

QueryCommand cmd = GetSaveCommand (username);



Then take a watch on cmd to see sql.

+2


a source







All Articles