IT Community - Software Programming, Web Development and Technical Support

XmlSerializer throws a exception: String was not recognized as a valid DateTime.

This is a discussion on XmlSerializer throws a exception: String was not recognized as a valid DateTime. within the C# Programming forums, part of the Software Development category; XmlSerializer throws a exception: String was not recognized as a valid DateTime. I am getting exception while using serialize and ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-19-2008, 11:17 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default XmlSerializer throws a exception: String was not recognized as a valid DateTime.

XmlSerializer throws a exception: String was not recognized as a valid DateTime.


I am getting exception while using serialize and deserialize an object,
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-19-2008, 11:18 PM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: XmlSerializer throws a exception: String was not recognized as a valid DateTime.

The XmlConvert class provided by .NET framework is use to encodes and decodes XML names and provides methods for converting between common language runtime types and XML Schema definition language (XSD) types.

The following code demonstrates the datetime conversion.

string dt1 = "2004/07/26 21:00:05";

DateTime dt2 = XmlConvert.ToDateTime(dt1, "yyyy/MM/dd HH:mm:ss");
__________________
The MOSS
Master of Solution Service
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-19-2008, 11:19 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: XmlSerializer throws a exception: String was not recognized as a valid DateTime.

oh...i didnt use that before ...thank u
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datetime datatype formate Kirubhananth ASP and ASP.NET Programming 3 03-10-2008 03:23 AM
Discussweb - Not valid url vadivelanvaidyanathan Discussweb HQ 3 02-10-2008 02:09 AM
I am getting 'String was not recognised as a valid DateTime' poornima ASP and ASP.NET Programming 2 02-01-2008 11:17 PM
How do you check if a date is valid? itbarota HTML, CSS and Javascript Coding Techniques 4 12-30-2007 11:21 PM
How do you check if a date is valid? itbarota HTML, CSS and Javascript Coding Techniques 4 12-19-2007 12:06 AM


All times are GMT -7. The time now is 07:43 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0