Harry
Harry

Reputation: 61

Column, parameter, or variable #6: Cannot find data type datetime2 in ASP.net core API project

enter image description here

When i run update-database in nuget console then datetime2 error comes, but when migration file has DateTime type for Doj field. Please provide solution.

I deleted the migration file and then regenerate it by commend add-migration init and then update-database but not working and same error comes. Result : Database created but tables not, means connection string is working.

Upvotes: 0

Views: 184

Answers (1)

Harry
Harry

Reputation: 61

finally problem solved,

Actually my sql server is old version and cannot have datetime2 type of datatype then i have to change type of insert data DOJ changes in migration file

then again i ran command

update-database

and table created successfully.

Upvotes: 0

Related Questions