Hi learner_test,
Thank you for posting in MSDN forum.
For Web application, you could refer to Creating a Connection String and Working with SQL Server LocalDB to
directly add localdb.
For Asp.net core application, please refer to Getting started with ASP.NET Core MVC and Entity Framework Core
using Visual Studio and later tutorial to use Code First Migrations.
Besides, this forum is discussing about .Net Framework Setup and Servicing, As your question is much related to Asp.net core, I suggest you could also post in
https://forums.asp.net/1255.aspx/1?ASP+NET+Core for a much professional support.
Thank you for your understanding and cooperation.
Best Regards,
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.