Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 3.5 SP1 Edition: In C# and VB by Bill Evjen, Scott Hanselman, and Devin Rader; ISBN: 9780470478264
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 5th, 2012, 10:21 AM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Cool String was not recognized as a valid DateTime

The folllowing line of code gives the error: String was not recognized as a valid DateTime. This happens at runtime, everything compiles with no problem.
I tried substuting DateTime.Now and got the same error. I also tried the commented out solution below, all trials gave the same error. At this point I'm out of ideas.

P.S. This is from Chapter 9, the Movie class setup. I commented out all the code to focus on getting the first Movie added and have had no luck up to this point.

System.DateTime str_date = DateTime.Parse("15/6/2001");

//System.Globalization.CultureInfo.CreateSpecificCul ture("en_AU").DateTimeFormat);

Last edited by ltimms; April 5th, 2012 at 10:27 AM. Reason: To add the chapter I am having the problem with
  #2 (permalink)  
Old March 25th, 2014, 05:04 PM
Friend of Wrox
Points: 528, Level: 8
Points: 528, Level: 8 Points: 528, Level: 8 Points: 528, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
Default

Default date format is MM/dd/yyy, your date sting is dd/MM/yyyy
 


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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
String was not recognized as valid datetime thillaiarasu Visual Studio 2005 2 November 2nd, 2007 05:19 AM
Cast from string to type Double not valid mika27 ASP.NET 2.0 Basics 0 January 31st, 2007 04:52 AM
How to convert a string in DateTime elena SQL Language 6 March 29th, 2006 05:59 PM
Err: Cast from String "" to type byte is not valid Parbish BOOK: Beginning VB.NET Databases 1 July 9th, 2005 05:43 PM
Cast from string "" to type 'Integer' is not valid h3x SQL Server ASP 1 January 30th, 2005 08:35 PM



All times are GMT -4. The time now is 02:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.