Forum Moderators: open
Use the compare validator, set the operator to DataTypeCheck and the Type=Date.
You could then just take the verified string and insert it into your database in what ever format you want.
-=casey=-
This is not a personal attack at all, forgive me if you see as such. It's more of a general rant of mine.
While I agree there's no reason to reinvent the wheel, we're actually NOT reinventing the wheel here. We're using the .NET framework, not VBScript. If people are going to learn to develop using .NET, I think it's only right to TEACH .NET, and not just feed them antiquated VBScript functions. So many people don't use the new technology to their advantage (or correctly, for that matter), and that's a sad thing.
This is not a personal attack at all, forgive me if you see as such. It's more of a general rant of mine.
Matt, if this wasn't a personal attack, why didn't you just post your solution instead of singling me out of the other people who had posted? Don't you think that would have been a little more appropriate than a rant and lecture?
I stand by my original post. I know that I could use regular expressions in conjunction with some other parts of the .net framework to solve the problem, but I've found the simplest solution is often the best. I, like others, need to save time wherever I can when writing code. If it's antiquated, I don't care. It produces the same result in the end.
You should realize that in programming, there's a tons of ways to do things. I appreciate that you feel your way is the "right" way. I've been there, but I don't think that these forums are what that is about. People post questions and other people help them out by posting possible solutions. There's always going to be solutions that aren't optimal or are flawed, but the best teaching comes from seeing all of those different approaches. How else do you learn?
Anyway, I think we've used this simple date validation thread for something more than it was intended. I wish to hijack it no further. If you'd like to continue this discussion, I suggest you sticky me.
Jefferson, I hope you've found your solution.
-=casey=-
Don't you think that would have been a little more appropriate than a rant and lecture?
He was only pointing it out, so that the user could understand the issues.
It's best to use good coding practices at all times when trying to help others on forums, it helps prevent them picking up bad habits.
When you suggest something that isn't best practice then it's wise to inform the recepient of that so that they can make an informed choice.