SqlDateTime溢出 [英] SqlDateTime Overflow

查看:86
本文介绍了SqlDateTime溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,
当我尝试从datetimepicker插入tu值时,发生SQLDateTime Overflow异常.该异常是


When i try tu insert value from the datetimepicker then a exception of SQLDateTime Overflow occurs.The exception is

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.





Please guide how to handle this?

推荐答案

您必须喜欢SQL DateTime,检查从您的应用程序发送到数据库的内容,然后检查日期格式在数据库中,大多数情况下,当您发送MM/dd/yyyy时,虽然数据库期望的是dd/MM/yyyy,请尝试使用collat​​e或CONVERT作为日期,尽管直到您看到发送的应用程序是什么,您才知道该如何处理.做

you gotta love SQL DateTime, check what is been sent to the database from your app, then check the format of the date in the database, most of the time you are sending MM/dd/yyyy while the database is expecting dd/MM/yyyy, try using collate or CONVERT for your dates, though until you see what is the app sending you will know better what to do

CONVERT(VARCHAR(10), GETDATE(), 101) 



将使您的日期为MM/DD/YYYY



will make your date MM/DD/YYYY


这篇关于SqlDateTime溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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