The conversion of a char data type to a datetime data type r

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
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.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

在本地上运行没问题.但发布到服务器上之后就出现了这样的问题,这是为什么呢?

hollypillow 1年前 已收到1个回答 举报

福间 幼苗

共回答了17个问题采纳率:82.4% 举报

获取时间用这个.DateTime.Now.ToString("d")

1年前

5
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.050 s. - webmaster@yulucn.com