Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly refresh ADO.NET Entity Data Model?

I am using ADO.NET Entity Data Model in my C# project. There is an ADO.NET Entity Data Model that is generated on the DB in my project. How do I quickly refresh the ADO.NET Entity Data Model based on DB changes? I have been deleting the model and then creating a new one. I believe that there is a more simple and quick way.

like image 242
Anton Avatar asked Dec 16 '10 22:12

Anton


People also ask

What is faster ADO.NET or ado net entity framework?

Performance: ADO.NET is much faster compared to the Entity Framework. Because ADO.NET always establishes the connection directly to the database. That's why it provides much better performance compared to the Entity Framework.

How do I update my Entity Framework database first?

Right-click anywhere on the design surface, and select Update Model from Database. In the Update Wizard, select the Refresh tab and then select Tables > dbo > Student. Click Finish.

Why is ADO.NET faster?

ADO.NET is made of a set of classes that are used for connecting to a database, providing access to relational data, XML, and application data, and retrieving results. ADO.NET provides better performance as it is directly connected to the data source, which makes the processing faster than Entity Framework.


2 Answers

Right-click on the model designer and choose "Update Model from Database", and a dialog box will pop up. Click OK and your model will be refreshed.

FYI, I'm using EF 4.0, and I skipped the earlier version, so I can't tell you what it's like in VS 2008.

like image 157
Dave Markle Avatar answered Oct 06 '22 01:10

Dave Markle


Update Model from Database doesn't work very well. At least in VS 2008/C# 3.5. I fails to remove old columns, etc.

like image 42
victor Avatar answered Oct 05 '22 23:10

victor