Last post Apr 12, 2017 09:46 AM by Eric Du
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.
Apr 10, 2017 02:06 AM|Eric Du|LINK
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:
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?
Apr 12, 2017 09:46 AM|Eric Du|LINK
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:
Entity Framework Code First to a New Database:
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: