0
I am trying to save a field of type date in the SQLSERVER database, however it does not insert, is returning me the following error:
Sequence not recognized as valid datetime.
DateTime dat = DateTime.ParseExact(txtVencimentoC.Text, "dd/MM/yyyy", null);
cadastrocontasreceber.Vencimento = dat;
I tried this way, and several others, but all return me the error. As I am doing the sum of dates by javascript, the field is of this format "Sun Nov 19 2017 00:00:00 GMT-0200 (Brazilian daylight saving time)" How can I format it to Datetime in Sqlserver, or how can I set it inside javascript by going to the already formatted txtVencimentC? For all forms return me the same error. I thank you.
I don’t know if it will work, but try to convert this date to timestamp and then send it to sql. See here how to generate the timestamp: https://stackoverflow.com/questions/9873197/convert-date-to-timestamp-in-javascript
– Felipe Coelho