Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > .NET Framework 1.x
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2007, 09:11 PM
Authorized User
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Conversion from string "" to type 'Date'

I keep getting error on this book

Instant result on Asp.net 2.0 instant result on online diary
this is DayView.aspx.vb

mDiaryEntry = New DiaryEntry(CInt(Session("DiaryId")), CDate(dayShownLabel.Text))

Is anybody know how to recorrect this problem?
my error message is

Conversion from string "13 8¿ù 2007" to type 'Date' is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Conversion from string "13 8¿ù 2007" to type 'Date' is not valid.



Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Line 19: mDiaryEntry = New DiaryEntry(CInt(Session("DiaryId")), CDate(dayShownLabel.Text))
Line 20: changeDayCalendar.SelectedDate = CDate(dayShownLabel.Text)
Line 21: changeDayCalendar.VisibleDate = changeDayCalendar.SelectedDate

 
Old August 11th, 2007, 04:12 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

Are you using different culture than degault en-us. If you are using en-us, check that there are some special characters in "13 8¿ù 2007". That's why it is unable to cast this string into Date. If you are using different culture than en-us, then problem can be something else.

Gaurav





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from string to type 'Date' error jellyjune BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 9 August 12th, 2007 02:05 AM
Conversion from type 'DBNull' to type 'String' is GailCG ASP.NET 2.0 Basics 5 February 22nd, 2007 03:12 PM
Conversion from type 'DBNull' to type 'Boolean' is steve35719 VB Databases Basics 4 June 29th, 2006 06:13 PM
Conversion from string to date kshantik Access 2 May 19th, 2004 12:17 PM
Conversion part of string to date MRvLuijpen Access 5 May 18th, 2004 02:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.