作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/07 21:28:51
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:

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

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