May 23, 2012 04:46 PM|Dev1411|LINK
I am trying to convert the data from a calender control from Ajax toolkit (for Date of Birth) using the code
create.DOB = System.DateTime.Parse(txtDOB.Text); but it throws an exception saying conversion to smalldatetime failed.
I also tried
create.DOB = System.DateTime.Parse(txtDOB_CalendarExtender.ToString()); .. still the exception is the same.
here create is the object of the class where I have defined the properties for passing the data into stored procedures for inserting the data. The Database works on smalldatetime everywhere.
the DOB property defined in the main class is of type DateTime..
Where am I wrong ? Kindly help urgently
Thanks in advance