Chapter 39. Manipulating Databases with the Entity Framework

I have seen estimates claiming that 80% or more of all Visual Basic applications involve a database. I've even seen one estimate that claims 95% of all Visual Basic applications involve a database at some point. Whatever the true number is, it's clear that a large fraction of Visual Basic programs use databases.

There are some good reasons for this. Databases provide a lot of useful features for storing, manipulating, updating, and retrieving data. A well-designed database can store huge amounts of data and still find a particular record quickly.

With such a strong emphasis on databases, it's small wonder that Microsoft spends a lot of time and effort providing tools to manipulate databases, and over the years Microsoft has developed many such tools. The latest of these is the ADO.NET Entity Framework.

In this lesson, you learn the basics of using the Entity Framework. You learn how to use it to map data in a database to objects in a program. You also learn how to build a simple program that uses the objects created by the Entity Framework to manipulate the data in the database.

ENTITY FRAMEWORK FEATURES

Although a detailed discussion of the Entity Framework is beyond the scope of this book, this section explains its general concepts and key features.

In brief, the Entity Framework is an object-relational mapper (abbreviated ORM, O/RM, or O/R mapper), a tool that maps between pieces of data in a relational database and objects ...

Get Stephens' Visual Basic® Programming 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.