i am in the process of porting an application from vb.net to C#.net. i am relatively new using C#.net so please bear with any seemingly stupid questions (there will be alot *sheepish grin*)
i have come to a point where i am converting a subroutine that checks items in a database according to a range of dates, now, the vb code is as follows:
If d1 = Date.MinValue And d2 = Date.MinValue Then
Else
End If
basically, what i am trying to do is make the C# equivalent of the above statement, but because i am so new to c# i am having trouble trying to do such a seemingly simple thing. i was under the impression that the eqivalent of 'and' in C# is '&&'... but it doesnt want to work in C# saying 'operator && cant be applied to datetime'
please somebody help me to understand what im doing wrong, its extremely important.
cheers
adam
Thet3 pointsPosted Mar 13, 2007, 8:40 PM EDT
if ((d1 == Date.MinValue) && (d2 == Date.MinValue))
{
//Do something
}
else
{
//Do something
}
Adam Grande23 pointsPosted Mar 13, 2007, 9:54 PM EDT
i figured it out (the == i mean) about 20mins after i posted this. i had forgotten about the operators in C# and how = and == are two different things.
cheers for the help mate, much appreciated
regards
adam