Re: Checking for a valid date

Tech-Archive recommends: Fix windows errors by optimizing your registry



Jason,

Doesn't IsDate use this same technique internally?

Kerry Moorman

"Jason Pettys" wrote:

> I recommend against this method in most cases; exceptions are
> resource-intensive and shouldn't really be used for raw user-data
> validation. It probably wouldn't matter much on a Win Forms app, but I
> would really back away from this on ASP.NET if you're expecting any
> volume of traffic.
>
> The IsDate would be a better way to go.
>
> Jason
>
> www.pettysconsulting.com
>
>
> Armin Zingler wrote:
> > "romy" <royalizi@xxxxxxxxxxxx> schrieb
> >
> >> What's the easiest way to verify the user had entered a valid date ?
> >>
> >>
> >
> > Call Date.Parse in a Try/Catch block. If there's no excecption the date
> > was valid.
> >
> >
> > Armin
>
.