Invalid Cast Exception with CDate

genie

New member
Joined
May 17, 2006
Messages
2
Programming Experience
Beginner
Hi

I am new to this forum and this is my first post. I have a difficulty. I have a search engine on one of my website that searches for flight. But that SE is showing an error on invalid cast exception.

[InvalidCastException: Conversion from string "05/21/2006" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.FromString(String Value, CultureInfo culture) +215
Microsoft.VisualBasic.CompilerServices.DateType.FromObject(Object Value) +131
LeastFareLankaServices.Service1.getClasses(String destFrom, String destTo, String dptDate, String dptMonthYr, String retDate, String retMonthYr, String TA, String Airline, String FlightType, String OneWayOrReturn, String databaseName) +674
virginatlantic.Flthltreasult.Page_Load(Object sender, EventArgs e) +4949
System.Web.UI.Control.OnLoad(EventArgs e) +98
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4310

I have used CDate. Please help how could I rectify this error. Do I need to make some changes in OS?
 
Back
Top