2013-03-13 35 views
0

我試圖讓用戶通過鏈接登錄的,但是當他們進入帳戶/ ExternalLoginConfirmation的默認模板,我得到這個錯誤的轉換:鏈接在dotnetopenauth - >一DATETIME2錯誤

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range 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 datetime2 data type to a datetime data type resulted in an out-of-range value.

任何熟悉該lib的錯誤的人?

+1

我相信我已經看到了這個,當我有一個日期時間數據庫列設置爲不爲空,我忘記在保存一個新的記錄期間分配一個值...尋找日期時間值沒有分配一個值在任何你正在做你的代碼。 – Tommy 2013-03-13 01:34:58

+0

謝謝!!堅持它在點的答案! – FutuToad 2013-03-13 20:04:41

+0

真棒 - 很高興你明白了! – Tommy 2013-03-13 20:12:16

回答

1

我在使用Entity Framework之前就看到過這個問題,當我將DateTime數據庫列設置爲非空值時,我沒有爲它賦值(我將它留空)。

檢查您的代碼並查找任何標記爲NotNull的DateTime屬性,並確保在提交更改/保存記錄之前分配這些屬性值。