By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Entity Framework 6 basics code samples


Karen Payne MVP
Jun 26, 2008
There are plenty of articles and code sample on the web while many of them are shown with C# code. In the following article I've taken bits and pieces from code samples on Microsoft Docs site and adapted them to Windows Forms.

The theme is code first, existing database with blogs and post (which Microsoft uses often). The following article does not teach how to start off with all possible directions which can be taken to lay the foundation for a Entity Framework project nor does it dig into custom configuration of a DbContent, it's meant to peek interest possible with developers who have considered using Entity Framework for WinForms but have not seen a very simple startup project.

Requires Visual Studio 2017 or Visual Studio 2019 and SQL-Server, data scripts are included.

Article Entity Framework 6 basic data operations (VB.NET) Window Forms and unpublished next part in the series.

Additionally I've started a portal on TechNet Wiki: VB.NET Entity Framework: Wiki portal Running through the articles note they are all Entity Framework 6 except for one which used Entity Framework Core 3.1 which mimics auto-saving data in a DataGridView similar to Microsoft Access.