SqlException:datetime2データ型をdatetimeデータ型に変換すると、範囲外の値が返されました。"SqlExceptionを解決する方法:datetime2データ型のdatetimeデータ型への変換は、範囲外の値になりました。
私のコードは次のようである:
using (var contxt = new realtydbEntities())
{
var status = GetStatus();
var repIssue = new RepairIssue()
{
CreaterId = AuthorId,
RepairItemDesc = this.txtDescription.Text,
CreateDate = DateTime.Now,//here's the problem
RepairIssueStatu = status
};
contxt.AddObject("RepairIssues", repIssue);
contxt.SaveChanges();
}
タイプはsmalldatetime型ある列にCREATEDATEプロパティマッピング。
このコードを実行するにはどうすればよいですか?
[datetime2データ型からdatetimeデータ型への変換は範囲外ですか?](https://stackoverflow.com/questions/7386360/the-conversion-of-a-) –