Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
donhuvy opened this issue May 2, 2020 · 4 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@donhuvy
Copy link

donhuvy commented May 2, 2020

I am using Microsoft.EntityFrameworkCore.SqlServer, Version=5.0.0-preview.3.20181.2

Exception log: https://gist.github.com/donhuvy/71d1773effecd39c561c2e8ccb4396ec

exception

razor

Blazor razor file https://gist.github.com/donhuvy/ecb28b20764cf57bffb914baa01c8fbe#file-salevoucher-razor-L333

database: https://gist.github.com/donhuvy/98268691b37a02cf74d273cb74dc37dc#file-applicationdbcontext-cs-L6148

My model: https://gist.github.com/donhuvy/61810e01a8c1c400314a95687cb0e5e7

My form: https://gist.github.com/donhuvy/339cd6d48c147aa7e8180f373fb0c7ca

dot net ef https://gist.github.com/donhuvy/e3e0a22949fdbba9de7a65ba10089033

Visual Studio: https://gist.github.com/donhuvy/f8e5a3ffa5888f04569b6f26a1f8650b

select @@VERSION;
Microsoft SQL Server 2019 (RTM-GDR) (KB4517790) - 15.0.2070.41 (X64)   Oct 28 2019 19:56:59   Copyright (C) 2019 Microsoft Corporation  Enterprise Evaluation Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 18363: ) 

Steps to reproduce

My Visual Studio project file: https://gist.github.com/donhuvy/4ceb946c35e132c40271929ac480aebe#file-acc133balzor-proj-L25

Further technical details

EF Core version:
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 5.0 preview
Operating system: Windows 10 x64 pro
IDE: Microsoft Visual Studio Community 2019 Preview
Version 16.6.0 Preview 5.0

@ErikEJ
Copy link
Contributor

ErikEJ commented May 2, 2020

If the SQL Server data type is "datetime", the lowest possible value is what the error message clearly states.

@ralmsdeveloper
Copy link
Contributor

@donhuvy
You are not passing data to PostedDate, which is a non-null field, SQL Server expects a minimum value of 1/1/1753, and .NET the minimum value is 1/1/0001, so it passes the value in PostedDate that solved your problem!

@donhuvy
Copy link
Author

donhuvy commented May 2, 2020

@donhuvy
You are not passing data to PostedDate, which is a non-null field, SQL Server expects a minimum value of 1/1/1753, and .NET the minimum value is 1/1/0001, so it passes the value in PostedDate that solved your problem!

Thanks @ralmsdeveloper , It works. I am sorry, it is not a bug.

@donhuvy donhuvy closed this as completed May 2, 2020
@ajcvickers ajcvickers added the closed-no-further-action The issue is closed and no further action is planned. label May 2, 2020
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
@Dra-123
Copy link

Dra-123 commented Sep 20, 2023

Hi donhuvy. I want to learn something. I have low vision and so I need big fonts as you did. Therefore, I want to make the Visual Studio appearance that I use look exactly like yours. What is the font name that you use? Can you share your font configuration? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

5 participants