网上找了些资料。mcsoft  datetime  smaldatetime 的区别, 1900-01-01 -- 2079-01-01知道他们两个关于精度的区别。还有这个问题与本机的时间设置也有关系,长时间还是短时间。
sql的语言设置。我把sql的语言设置为E,本机时间都设置为长时间 还是有这个错误。最近一直在为这两个问题苦恼,没有解决办法。望各位朋友指点指点。谢谢。。

解决方案 »

  1.   

    smalldatetime和系统设置无关。
    下面的解释来自msdn.The smalldatetime data type stores dates and times of day with less precision than datetime. The Database Engine stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight.smalldatetime values that are 29.998 seconds or less are rounded down to the nearest minute; values of 29.999 seconds or more are rounded up to the nearest minute.Data type       Range                                          Accuracy  
    datetime       January 1, 1753, through December 31, 9999      3.33 milliseconds
    smalldatetime  January 1, 1900, through June 6, 2079           1 minute
     
      

  2.   

    谢谢大家,总算找到原因了。由于当前实体引用的实体,我在对其赋值的时候是new的一个新对象,所以会向数据库插入数据,而这时引用的实体中的时间字段没有赋值,系统默认为01-01-01 00:00:00 ,这事sql 的 smalldatatime 限制为1900....2079......所以就报这个错误了。