Do like this
String[] tmp = datevariable.Split("/")
DateTime newDate = new DateTime(tmp[0], tmp[1], tmp[2])
newDate will be u r new date.
-----Original Message-----
From: mohanraj [mailto:[EMAIL PROTECTED]
Sent: 01 November 2004 11:43 AM
To: [EMAIL PROTECTED]
Subject: [Microsofts_C_Sharp] How to assign String value to date.
HI :
How to convert string to Date Value..
here this is code
System.DateTime dt = new System.DateTime ();
dt = System.DateTime.ParseExact("02/06/2004");
when i try to convert iam getting following Error.
System.FormatException: String was not recognized as a valid
DateTime.
Regards,
J. Mohanraj
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/XGgtlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Microsofts_C_Sharp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/