Hi @Gcobani Mkontwana ,
i want to find a way to call datetime column from my database not hardcode cz
To access data from the database, you could refer the following article/tutorial to use EF core:
Getting Started With Entity Framework Core - ASP.NET Core
Creating a Model for an Existing Database in Entity Framework Core
Tutorial: Get started with EF Core in an ASP.NET MVC web app
then you can access the data via the DbContext, code like this:
public async Task<IActionResult> Index()
{
return View(await _context.Students.ToListAsync());
}
Besides, for the datetime property, if you don't want to hardcode, you could also set the default value, check this article.
If I misunderstand your question or is there any unclear about my reply, please let me know freely.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion