Friday, April 12, 2013

How to view parameterised query parameters that are passed to a command in visual studio during debugging

The Immediate window is used to debug and evaluate expressions.To access the immediate window in debug mode one has the following options: Type Control-Alt-I In the command window, type imme Or find the option “Immediate Window” in the “view” menu. Most often we want to view what exactly is going into parametrized query at run time,in such a scenario immediate window can be very helpful to us.If we want yo view any parameters value in sql command we can just view those values in immediate window. Eg:- Suppose we are passing parameters to a command object as db.cmd.parameters.AddWithValue("@id",somevalue) Now if we want to know what exactly has gone as parameter in cmd we can view that in Immediate Window ?db.cmd.Parameters("@id").Value For more details regarding various commands for immediate window please visit the following URL http://msdn.microsoft.com/en-in/library/f177hahy(v=vs.80).aspx

No comments :

Post a Comment