InstantASP Community Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Easiest eay to capture SQL... Expand / Collapse
Author
Message
Posted 27/02/2006 16:32:27
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19, Visits: 95
I've written a couple of SQL user defined functions for my current forum that perform full text queries significantly faster than the monster SQL statement built in ConstructManualSelectStatement found in InstantASP.InstantForum.Business.Search.vb. I'd like to display the SQL statement that's executing on the webserver if possible instead of grabbing it qith sql profiler if possible. I've got syntax error and it's difficult to debug this way. is there an easy way to output the text query?
Post #10201
Posted 27/02/2006 16:49:14


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Customers
Last Login: 19/11/2007 22:07:59
Posts: 161, Visits: 2,483
If you're on a dev box and have source code, you should be able to just response.write it from anywhere in the app...  Might need HttpContext.Current.Response.Write(...) depending on where you are in the app.

That what you mean?

<-- Didn't realilze there was any SQL generated within the code.


Al Bsharah
Free Stores - http://www.aholics.com
Post #10202
Posted 27/02/2006 17:50:11
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19, Visits: 95
kinda, that's what I'd like to see.

I really just need to get a .net tutorial or a good book and I won't sound like such an idiot.

BTW, I tried that and it doesn't work where I'm at in the code but I'll figure it out.

Thanks for your help.
Post #10204
Posted 27/02/2006 17:56:10
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19, Visits: 95
I guess a better way to do this would be to add the full SQL statement that fails to the error exception handler so that this block of text also includes the full SQl statement:

Exception Type: System.Data.SqlClient.SqlException
Exception Message: Incorrect syntax near the keyword 'GROUP'.
Exception Source: .Net SqlClient Data Provider
Exception Target Site: HandleException


Any idea how to do that?
Post #10205
Posted 27/02/2006 18:07:57
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19, Visits: 95
...Didn't realilze there was any SQL generated within the code.


There's actually quite a bit of it.
Post #10206
Posted 05/03/2006 22:45:23
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 05/03/2006 22:37:30
Posts: 4, Visits: 13
I've found that SQL Profiler helps when trying to debug the executing SQL code. If you have access to run SQL Profiler you will be able to see the exact calls the application makes to the database. This was very helpful for me when I was porting our old forums over to the new package and I needed to debug my porting scripts. It helped me to see exactly how IF runs.
Post #10282
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ryan Healey, Mark Christianson, Bare, James Trott

Permissions Expand / Collapse

All times are GMT, Time now is 8:01pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.125. 10 queries. Compression Disabled.
Home | Products | Purchase | Support | Company | Contact Us
Privacy Statement | © 1999-2007 InstantASP Limited. All Rights Reserved.