Saturday, 10 February 2018
Database First Approach in MVC.
in: mvc
In this article, We will discuss about How to Create Database First Approach in MVC.
First of all, Create one Sample MVC Application and also Consider One Database and in that Database Create one table.
Goto Visual Studio -> Goto Solution Explorer.
Now, We need to add an "ADO.NET Entity Data Model" and Which can be add in any Folder or you can add under Project also and here, i added under my Models Folder.
Goto Models Folder -> Right Click on it -> Click Add -> Click "New Item" -> Then a new PopUp Will Come and there we need to select "ADO.NET Entity Data Model" and Which is Shown in below figure,
Click Add and a new Popup Will Come Which is Shown in below figure,
Click Next and a new Popup Will Come.
After that, Click New Connection and FillUp all the required Details and Click Ok.
Click "Yes, include the sensitive data in the connection string" and Which is Shown in below figure,
Click Next -> then We need to Choose the Entity Framework Version and Click Next.
In the last, We need to Choose What are the tables,Views and Stored Procedures and Functions need to add and Which is Shown in below figure,
Click Finish.
After that an edmx File added under that Particular Location and also a ConnectionString added under Web.config file, Which is shown in below figure,
By Using the Entities Class now we Can Perform our CRUD to that Particular table.
Note:- This is Just a sample Application and you can change as per your requirement.
RELATED POSTS
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
This issue is related to EntityFramework. This issue arises when we have ...

Difference between List and IEnumerable in C#.
In this article, We will discuss about What is the difference between Li ...

How to Set the favicon in MVC.
In this article, We will discuss about How to Set the favicon in MVC. ...

Max request length exceeded Error.
This issue arises when you have set some value in maxRequestLength and t ...
-
This issue is Completely related to EntityFramework and this issue arises whenever you have installed EntityFramework in one project at th...
-
This is generally a Common Problem or the error could be like this, To Resolve this error, One Small Solution is Exists which is as b...
-
In this article, We will discuss What is the above Error and How to resolve this Error. Whenever, We are Restoring our database into A...
0 comments:
Post a Comment