Take the following function:
DataTable go() {
return someTableAdapter.getSomeData();
}
When I set a breakpoint in this function, is there a possibility to inspect the returned value? go()
is directly coupled to a datagrid in an .aspx
page.
The only way to inspect the returned datatable is to use a temporary variable. However, that's a bit inconvenient. Isn't there another way?
Drag and drop the return expression into a watch window.
For example, in the statement
drag and drop
into a watch window, and you'll see the value.
You can do this for any expression.
I wanted to expand upon PascalK's answer for getting this to work in Visual Studio 2015, because there is a hidden feature which is not documented in Examine return values of method calls.
If you have nested function calls, the pseudo-variables
$ResultValueX
are automatically created, where the X refers to the function call order. So if you have a call such asMultiply(Five(), Six())
, the following pseudo-variables are created: