Hi folks,
Im having trouble converting text to date and comparing them. Is there a similar to VB.Nets IsDate in C# 2005? Please check out the code below and see if you can find whats wrong. Yeah, I know, Im a newbie... The code in red is where Im getting the error messages:
--------------------------------------------------------------------------
1) Checking if the text of a TextBox is date:
if IsDate(this.Date1TextBox.Text)
{
}
--------------------------------------------------------------------------
2) Converting and comparing the dates of two TextBoxes:
if (Convert.ChangeType(this.Date1TextBox.Text, DateTime) > Convert.ChangeType(this.Date2TextBox.Text, DateTime))
{
}
--------------------------------------------------------------------------
Thanks a lot,
JC
Im having trouble converting text to date and comparing them. Is there a similar to VB.Nets IsDate in C# 2005? Please check out the code below and see if you can find whats wrong. Yeah, I know, Im a newbie... The code in red is where Im getting the error messages:
--------------------------------------------------------------------------
1) Checking if the text of a TextBox is date:
if IsDate(this.Date1TextBox.Text)
{
}
--------------------------------------------------------------------------
2) Converting and comparing the dates of two TextBoxes:
if (Convert.ChangeType(this.Date1TextBox.Text, DateTime) > Convert.ChangeType(this.Date2TextBox.Text, DateTime))
{
}
--------------------------------------------------------------------------
Thanks a lot,
JC