.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Helping you always. Don't forget to click "Mark as Answer" on the post that helped you.
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
Member
2 Points
2 Posts
appsettings.json
Jul 11, 2020 03:32 PM|Buronya Kofi|LINK
Am a beginner ASP.NET. Created Razor Project , have created my class ,
have created my dB Context class,
have created Database,
from the property of my Database I can get my Connection String
How do I get the Connection String into the appsetting.json file.
I copied and pasted but it does not work
Contributor
4973 Points
4259 Posts
Re: appsettings.json
Jul 11, 2020 05:03 PM|DA924|LINK
https://www.connectionstrings.com/store-and-read-connection-string-in-appsettings-json/
There are plenty of articles on the subject.
Contributor
2720 Points
874 Posts
Re: appsettings.json
Jul 13, 2020 08:51 AM|Rena Ni|LINK
Hi Buronya Kofi,
You could set the ConnectionString(What I marked as green could be changed by yourself ) in the appsettings.json like below:
And get the connnection string like below:
Reference:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql?view=aspnetcore-3.1&tabs=visual-studio
Best Regards,
Rena
Participant
1253 Points
943 Posts
Re: appsettings.json
Jul 13, 2020 11:19 AM|yogyogi|LINK
Kindly refer How to Setup and Configure ASP.NET Core Identity
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
Member
2 Points
2 Posts
Re: appsettings.json
Jul 13, 2020 01:36 PM|Buronya Kofi|LINK
Thank you so much
BK