Debug sproc [MSSQL stored procedures] in VS

( Source: http://aspalliance.com/1131_Understanding_Object_Pooling_in_Microsoft_NET )

In VS at the Sever Explorer pane I right-click on my data connection that I added and select Modify Connection. Then in the Modify Connection dialog I clicked Advanced... and then in the Advanced Properties dialog I changed Pooling from True to False. Now it works. Also, in the configuration file, the Enable SQL Server debugging must be checked. Also, I have to add cmd.CommandTimeout=1800 to the VB's sproc area else it will time-out while clicking thru the sproc in the debugger.

But, when not debugging, in order to get the app to run to completion without crashing with the error Error while executing 'a batch cmd' at line 0 , I have to uncheck Enable SQL Server debugging and set Pooling back to True. --Because not pooling the connections hurts performance.

(Summary: You do the above to VS so that you can step through,and see, the database while debugging the code of an app in VS.)

No comments:

header adsense code