date validation

S

suvra saha

i want to insert a date validation between jan'09 to april'09 in c#



maz77 wrote:

date validation
03-Jul-08

I am trying to develop a good validation for a date in C#; a valid dat
can be inserted in these formats
- dd/mm/yyy
- dd/mm/yyyy h24:
- mm/dd/yyy
- mm/dd/yyyy h12:
How can I proceed
Is "Datetim

Previous Posts In This Thread:

date validation
I am trying to develop a good validation for a date in C#; a valid dat
can be inserted in these formats
- dd/mm/yyy
- dd/mm/yyyy h24:
- mm/dd/yyy
- mm/dd/yyyy h12:
How can I proceed
Is "Datetim

Re: date validation
Yes it is

However, you have posted your question on an ASP.NET newsgroup, so I a
assuming that you intend to use this in an ASP.NET app..

There is, generally speaking, no need to use server-side

Re: date validation
Mark Rae [MVP] wrote

Surely you should mention the caveat about protecting against maliciou
users who might bypass the client-side validation for the purposes of SQ
injection, XSS, or just plain i

Re: date validation
SQL Injection is fairly simply bypassed by using stored procedures and / o
parameterised queries

As for invalid dates specifically, they can be avoided completely by using
calendar control, the p

Re: date validation
Mark Rae [MVP] wrote

I was writing about malicious users in particular, who will hav
tools/browser add-ons to alter the data en route from the browser to th
server or enter data directly into hidd

HiIs "Datetime.TryParse()" a good choice?
H

Is "Datetime.TryParse()" a good choice

yes it i

Best of luc

Munn

www.munna.shatkotha.com/blo
www.munna.shatkotha.co
www.shatkotha.com

EggHeadCafe - Software Developer Portal of Choice
ASP.NET: Jazz Up the Xml Control
http://www.eggheadcafe.com/tutorial...a4cc-447fabc77689/aspnet-jazz-up-the-xml.aspx
 
G

Guest

i want to insert a date validation between jan'09 to april'09 in c#

You can try to do something like this

DateTime d1 = Convert.ToDateTime("1/9/2009");
DateTime d2 = Convert.ToDateTime("4/9/2009");

if (mydate >= d1 && mydate <= d2 )
{
// ok
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top