View Single Post
Old 05-07-2009, 11:01 PM   #4 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

When I debug queries in .net, I use the following steps:
1. Output the formatted query that you are sending. That means you echo the exact same string you are giving the database. That can reveal potential errors that are in the variables.
2. Simulate a correct query in the database viewer.
3. Erase the query and re-write it from square one
4. Repeat

I've only had to ask two questions regarding queries in the last year with this method (and don't say I am better with SQL, I have had to write extremely advanced queries I learned how to write ten minutes before).
__________________

Village Idiot is offline  
Reply With Quote