Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms Entity Framework

I am attempting to follow a tutorial regarding Winforms and Entity Framework, but am having difficulty following along.

The tutorial I am using is from CodeProject.com and can be found here. The problem I have is that the tutorial references two controls, EntityDataSource and EntityBindingNavigator, which I cannot find in my toolbox.

enter image description here

I have tried to right-click on my toolbox and clicked "Choose Items...", but I still cannot find these two controls. Although EntityDataSource is selected in the following image, it does not appear in my toolbox (perhaps because it's from the System.Web assembly?):

enter image description here

I have chosen the references I would assume I need, but it does not help the situation:

enter image description here

I am using Visual Studio 2012 Update 4. The tutorial is from Feb 2014, so I can't imagine I cannot find these controls because the tutorial is using an extremely old version of VS or something along those lines.

I am completely lost, especially because the tutorial has so many good ratings; apparently, it's just me who can't find these dang controls! I have found other posts from users who cannot find them, but the solution is usually to right-click the toolbox and click "Choose items..." (which I have done, to no avail).

Any other suggestions? Your help is greatly appreciated!

like image 212
Sesame Avatar asked May 24 '14 23:05

Sesame


People also ask

Can you use Entity Framework with Windows Forms?

Perform CRUD Operations Using Entity Framework. First of all, create a Windows Forms App. To create a new app click on file menu > New > New project and select Windows Forms App then click on Next button. ProjectName - Enter your project name in this field.

Is WinForms still used in 2022?

Now, in 2022, with increasing competition and the adoption of newer more modern technologies the popularity and usage of WinForms are at an all-time low.

Is WinForms obsolete?

Win Form has been used to develop many applications. Because of its high age (born in 2003), WinForm was officially declared dead by Microsoft in 2014.


1 Answers

According to the sidebar in the link, the CodeProject article is about "A component that makes it easy to use Entity Framework in WinForms projects, including design-time binding support."

The article itself (I didn't read it in detail) appears to be more about how to use the component, not directly about using Entity Framework in WinForms. The article author has created a library (EFWinForms), and it is included in the downloads. For example, I downloaded the EF6 C# code, which has two projects and one solution - an EF6WinForms project and Sample project.

To follow along with the example, or use the EFWinForms library in your own project, you can add the project (from the download) to your solution and reference it, and then add the appropriate using (Imports for VB.NET) statements.

If you want to add just the DLL pick then build the EFWinForms project (it'll probably have a slightly different name depending on the version), and then add a reference to that DLL.

like image 157
Tim Avatar answered Oct 05 '22 23:10

Tim