DOB textbox1(Calendar image) Wedding Day textbox2(calendar image)
DateTime DOB = Convert.ToDateTime(FromDate.ToString()); DateTime Wed = Convert.ToDateTime(Todate.ToString()); if (DOB.Day = Wed.Day && DOB.Month == Wed.Month && DOB.Year == Wed.Year) { Label6.Text = "Date of Birth And Wedding day should not be the same"; }
if (DOB.Day = Wed.Day ...
if (DOB.Day == Wed.Day ...
if( DOB.Date == Wed.Date) { //invalid } else { //valid }
Quote:if (DOB.Day = Wed.Day && DOB.Month == Wed.Month && DOB.Year == Wed.Year)
=
==
DateTime
if (DateTime.Compare(DOB, Wed) == 0) { Label6.Text = "Date of Birth And Wedding day should not be the same"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)