?
Solved

C# Debugging in the intermediate window

Posted on 2012-08-13
6
Medium Priority
?
307 Views
Last Modified: 2012-09-13
Hi,

I have some break points in my code. When they get hit I want to be able to check the values of my datareader. I used to use the writeline method in the intermediate window. However I can't remember or get it to work again.

I have the System.Diagnostics namespace so not sure what I'm doing wrong.

Any help would be great,

Cheers
M
0
Comment
Question by:mcs26
6 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 38289461
Are you talking of Immediate window?

CTRL + ALT + I
0
 
LVL 7

Expert Comment

by:Element1910
ID: 38289513
I think I know what you mean...you want to output some values to the Immediate Window when in debug mode, however, you are using the wrong write method. Try:

Trace.WriteLine().


Console.Write() and Console.WriteLine() only works in console apps. Try the Trace.Write() or Trace.WriteLine() instead.
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 38289528
You can also manually interrogate by typing something like

?dr("MyColumn")

into the immediate window.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 13

Accepted Solution

by:
jonnidip earned 2000 total points
ID: 38291895
You can also take advantage from the use of DebugView.
It will show you both "Debug.Write" and "Trace.Write", depending on what configuration you are running.
0
 

Author Comment

by:mcs26
ID: 38301102
Sorry for the delay in getting back.

I have tried the suggestions above and still nothing. The intelii sense never picks up anymore when I type in the intermediate window. I should add I'm making an WPF application so not sure if that makes a difference?

Thanks for any help,

M
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 38350785
Intellisense doesn't always work in the immediate window.  You can try hitting ctrl + space to bring up the intellisense if available.  Also be sure that you're in debug mode and not building it for release.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question