“值'20 .1.2012 0:00:00'对于'值'无效. [英] "Value of '20.1.2012 0:00:00' is not valid for 'Value'.

查看:66
本文介绍了“值'20 .1.2012 0:00:00'对于'值'无效.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"2012年1月20日0:00:00的值"对于"Value"无效."Value"应介于"MinDate"和"MaxDate"之间.\ r \ n参数名称:值"
问题是``MinDate''设置为``1.1.0001 0:00:00'',而``MaxDate''设置为``31.12.9999 23:59:59''.
有没有人看到问题的根源以及发生的原因?

"Value of ''20.1.2012 0:00:00'' is not valid for ''Value''. ''Value'' should be between ''MinDate'' and ''MaxDate''.\r\nParameter name:Value"
The problem is that the ''MinDate'' is set up as ''1.1.0001 0:00:00'', and the ''MaxDate'' is ''31.12.9999 23:59:59''.
Does anyone see what is the problem, and how it occured?

推荐答案

检查您的文化:日期格式是否设置为接受".作为日期部分分隔符?如果不是,则2012年1月20日不是有效日期,但可能是20/1/2012.
Check your culture: Is your date format set to accept "." as a date part separator? If it isn''t, then 20.1.2012 is not a valid date, but 20/1/2012 may be.


DateTime dateValue = DateTime.Now;



在查询中像这样使用



Use like this in query

''" + dateValue.ToString("MM/dd/yyyy hh:mm:ss tt") + "''


这篇关于“值'20 .1.2012 0:00:00'对于'值'无效.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆