I am a C # / asp.net developer and I need to work with VB / asp.net. I started with VB.NET, but after a few years from it I got confused in the syntax.
I have two variables
Dim originalDate as DateTime?
Dim newDate as DateTime?
Both values are with zero value, originalDate is the zero date that I get from the database, and the newDate time is set in the code, I need to compare them, they can either have dates, or have dates, or one, and the other not.
I have some code as follows:
if origEndDate = origEndDate then
When both origEndDate and origEndDate are “nothing”, this statement is false (well, when I run it in the viewport, it returns as nothing)!
I don’t understand why this is so, because I had the impression that “=” compares two values, and since they are the same, should this be true?
- , ? , #, :
if (origEndDate == origEndDate) { }
.
Confused!
!