Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Datetime2 Issue on Server

Tags:

asp.net

In my ASP.NET application, everything works as expected when running it locally but when I publish the server I get the following error:

"The version of SQL Server in use does not support datatype 'datetime2'."

How can I resolve this error?

like image 941
Mohit Kumar Avatar asked Aug 01 '26 00:08

Mohit Kumar


2 Answers

If you are using Entity Framework model in your project.
Then open entity model in html or xml mode. and change ProviderManifestToken="2008"
to ProviderManifestToken="2005". after that publish on server then check and let me know.

According to this article, SQL server 2008+ supports datetime2. I am assuming your server does not run SQL 2008+ but your local SQL Express does.

Difference between datetime and datetime2

like image 36
Josh Avatar answered Aug 03 '26 13:08

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!