Hi
I have attached Excel file. I uploaded on shared server . 20 records got updated . On 21st record it gave error - String was not recognized as a valid DateTime. Could not store 15-04-2023 in Date Column. Expected type is DateTime.
Server formatis - mm-dd-yy. How it is possible few records got updated and few left.
/forums/uploadfile/f61a1a/04042023163802PM/Sample.xlsx
When i ran on local system where format is dd-mm-yyyy it worked perfectly.
Thanks
Rajkiran SwainPosted Apr 4, 2023, 5:55 PM
I am not able to see your sample excel file. Please upload it again .
Ramco RamcoPosted Apr 4, 2023, 4:57 PM
Hi RajKiran
Issue is how few records got updated & few not. U can check excel file all date fields r in same format
Thanks
Rajkiran SwainPosted Apr 4, 2023, 4:51 PM
It's possible that the date format in the Excel file is not compatible with the format expected by the server.
For example, if the server is expecting dates in the format "mm-dd-yy", and the Excel file has dates in the format "dd-mm-yyyy", then the server may not be able to recognize some of the dates, resulting in the error message you received.
To resolve this issue, you can try one of the following solutions:
Change the date format in the Excel file to match the format expected by the server. You can do this by selecting the date column in Excel, and using the "Format Cells" option to change the date format.
Modify your code to handle different date formats. You can do this by converting the date string to a DateTime object using a format string that matches the format of the date in the Excel file. For example, if the date format in the Excel file is "dd-mm-yyyy", you can convert the date string to a DateTime object using the format string "dd-MM-yyyy".