I am learning about .NET and for this purpose I have downloaded the application called SocialGoal in GitHub.
After built the app and executed, I am trying to create a new account but the explorer give a error, looks like SQL, probably related with the database which I don't know how to create or configure in order to use the app.
I tried with dotnet update-database and does not work and enable migrations.
I read something about changing the connectionStrings on the file web.config but I don't know what to add there or change.
I will do appreciate some help with the steps to do it.
According to your description, I search this
tutorial , as far as I know, this sample is use code first and MVC. About your issue, you could try the following steps;
1. use code first to create dbcontext and create database.
2. configure it in xml file and web.config.
For more detail, please refer to the following tutorial:
Getting Started with Entity Framework 6 Code First using MVC 5:
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
5 Posts
How to build the database
Apr 09, 2017 09:56 PM|Markines1|LINK
I am learning about .NET and for this purpose I have downloaded the application called SocialGoal in GitHub.
After built the app and executed, I am trying to create a new account but the explorer give a error, looks like SQL, probably related with the database which I don't know how to create or configure in order to use the app.
I tried with dotnet update-database and does not work and enable migrations.
I read something about changing the connectionStrings on the file web.config but I don't know what to add there or change.
I will do appreciate some help with the steps to do it.
Contributor
6680 Points
2715 Posts
Re: How to build the database
Apr 10, 2017 02:06 AM|Eric Du|LINK
Hi Markines1,
According to your description, I search this tutorial , as far as I know, this sample is use code first and MVC. About your issue, you could try the following steps;
1. use code first to create dbcontext and create database.
2. configure it in xml file and web.config.
For more detail, please refer to the following tutorial:
Getting Started with Entity Framework 6 Code First using MVC 5:
https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
5 Posts
Re: How to build the database
Apr 10, 2017 09:23 PM|Markines1|LINK
Thank you Eric for your answer,
I am very new with .NET . how to create the database and dbcontext?
Contributor
6680 Points
2715 Posts
Re: How to build the database
Apr 12, 2017 09:46 AM|Eric Du|LINK
Hi Markines1,
About how to create database, you could use code first to create database. Also you could manually create database in SQL Server or VS.
How To Create Database Project In Visual Studio 2015How To Create Database Project In Visual Studio 2015:
http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-create-database-project-in-visual-studio-2015/
Entity Framework Code First to a New Database:
https://msdn.microsoft.com/en-us/library/jj193542%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
About DBContext is a reflection of database, you could operate DBContext, then save, it will be saved into database.
Here is a tutorial about create DbContext, please check:
Create Entity Data Model:
http://www.entityframeworktutorial.net/EntityFramework5/create-dbcontext-in-entity-framework5.aspx
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.