tags:

views:

142

answers:

5

I am debugging and I hit my break point. I hover over a variable and I get the standard drilldown. I see a Nullable prop and it is null. I right click and choose "edit value". No matter what I seem to type, I get "The value could not be set. Please check your entry." I have tried 5/1/09, new DateTime(2009, 5, 1), {05/01/2009}... pretty much every flavor I could think of. What the heck am I doing wrong? I would like to code in the value and continue debugging with the new value.

Any suggestions?

Thanks, ~ck

A: 

Try using #5/1/2009#

IPX Ares
+2  A: 

Seems easy to me. I had this line:

    DateTime dt = DateTime.Parse("01/01/2000");

Hit the breakpoint, and typed this into the immediate window:

dt = DateTime.Parse("02/01/2010")

The same technique also works when editing the value in the debugger tooltip, the locals window, the autos window, the watch window and even the quick watch window.

RichardOD
A: 

DateTime.Parse("5/1/2009")

Oren Trutner
This worked fine. Thanks!
Hcabnettek
A: 

In a Watch window line, type this in the name field:

dt = new DateTime(2009,5,1)

The line will be disabled so just delete it. In the next line, type in dt and it will be the value you want.

Austin Salonen
A: 

Is this object a "DateTime" or a "Nullable" (which is the same as "DateTime?")?

Steven Sudit