O'Reilly logo

Professional Visual Basic 2012 and .NET 4.5 Programming by Todd Herman, Gastón Hillar, David McCarter, Rob Windsor, Billy Hollis, Bill Sheldon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

Using an Object-Relational Mapping (ORM) tool like the Entity Framework greatly simplifies the creation of a database application. The Entity Framework manages many of the details of converting your logical application model into the physical database model, automatically mapping data types between Visual Basic and T-SQL. It provides the ease of use of LINQ to SQL while giving you the flexibility to work with the entities as designed, rather than being constrained to what is possible with T-SQL.

This chapter looked at how you can connect to a database using Entity Framework. One of the benefits of the Entity Framework is that the model you use to work with your data does not have to exactly match the tables in your database. As you saw, the Entity Framework does this through the creation of three XML files to manage the mapping between the two.

In addition, you saw how the Entity Framework greatly simplifies editing the database. The amount of code required to update a database “by hand” using ADO.NET (i.e., using DataReader and/or DataSet) is much larger than the amount you need to write when working with the Entity Framework.

This chapter showed only the features of Entity Framework that you are most likely to use for quick, simple models. There are many more features, like code first and the new DbContext object, just to name a few. To learn on more of what you can do with the Entity Framework visit the Entity Framework site by going to http://msdn.microsoft.com/en-us/data/ef.aspx ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required