i have a textbox control which displays date (only in MM/dd/yyyy format) from database & a datetime picker for entering another date (usually current date but might be past or future date).When user pickes the date from datetime picker, i have to compare this date with textbox's date and throw some message.Can anyone help me in this matter? i tried with following codes
string textdate1 = textbox.text;
string textdate2 = datetimepicker1.text;
System.DateTime d1 = System.DateTime.Parse(textdate1);
System.DateTime d2 = System.DateTime.Parse(textdate2);
if (System.DateTime.Compare(d1, d2) < 0)
{
MessageBox.Show("date 2 is later then date 1");
}
its urgent plz...