How To Insert Data Using Entity Framework In Visual Studio



First of all add Entity Framework to your solution as shown in the link.
How To Add Entity Framework In Visual Studio

For Inserting the data using Entity Framework follow these code.

How To Insert Data Using Entity Framework In Visual Studio, Insert Data Using Entity Framework, Add Data Using Entity Framework, Add Entity Framework In Visual Studio, SaveChanges, Entity Framework, Visual Studio, Asp.Net, Asp.Net MVC, WCF, HTML, Web Application

Here TechnomarkEntities is the instance of Entity Model. Using enclosure do the automatic Connection Open and Close. First of all create an instance of table that needs to be inserted. Then we create each Row to be Inserted. Assign values to the newly created rows. Add these rows to the instance of table. Then Update to database using SaveChanges method of Entity Framework. By this way we can Insert Data Using Entity Framework In Visual Studio