Shailesh Bist

Shailesh Bist

  • NA
  • 10
  • 518

DateTime binding in MVC Core

Dec 9 2022 4:59 AM

Hello,

This is my first try at MVC Core. 

I have a table with datetime data type. I have defined the model for this table.

When I declare the property in the model as datetime, the model does not show any records.

When I declare the property as string, the model shows data, but then then the context returns invalid cast from datetime to string error.

Kindly guide.

Thanks.


Answers (6)