Entity Framework: in visual basic how do i create class model

Gordon Lanham 20 Reputation points
2026-07-31T15:22:23.5366667+00:00

what projects IN visual basic do i need to create and their purposes I have an existing MSAccess data base which needs to be extended with more functions

Microsoft 365 and Office | Access | For home | Windows
0 comments No comments

Answer accepted by question author
Marcin Policht 101.4K Reputation points MVP Volunteer Moderator
2026-07-31T15:30:48.7766667+00:00

In a Visual Basic .NET Entity Framework application, you typically create a Class Library project to contain your data models and database logic, and a separate application project for the user interface or business functions.

A common structure is:

  • Windows Forms App / WPF App (VB.NET) Purpose: The user interface. This contains your forms, controls, and code that handles user interaction. It calls into your data/business layers rather than directly working with the database.
  • Class Library (.NET Framework or .NET) - Models/Data Layer Purpose: Contains your Entity Framework models. You create classes that represent your database tables, for example Customer, Order, or Product. These classes become your entities. It also contains the DbContext class, which manages communication with the database.
  • Class Library - Business Logic Layer (optional but recommended) Purpose: Contains application rules and processes, such as validation, calculations, workflows, or operations that involve multiple entities. This keeps your UI code cleaner.

For an existing MS Access database, you can use Entity Framework Database First. Install the Entity Framework package, add an ADO.NET Entity Data Model to your data project, choose EF Designer from database, and select your Access database. Entity Framework will generate the entity classes and context automatically.

The typical flow is:

Windows Forms/WPF App → calls → Business Logic Layer → uses → Data Layer (Entity Framework Models) → connects to → MS Access Database

For a small Access extension project, you can simplify this to two projects: a VB.NET UI project and a Class Library containing your Entity Framework models and database access code. For a larger application, separate the business logic layer as well.


If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

hth

Marcin

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Gordon Lanham 20 Reputation points
    2026-08-07T18:04:55.56+00:00

    accepted answer need to tryout later

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.