Data sources toolbox for VS2012 does not display my entity model - entity-framework

After adding an entity model either from the datasources toolbox itself or by adding it => "add" => "new item" it does not show up in the datasources toolbox and therefor i dont get that easy drop and drag functionality.
If I add a dataset it works but that is an older technology (is it not?) everything in my current project are entity models and to change to datasets (which only works if I add xmlns:yourAlias="clr-namespace:WpfApplication3") would be .. I don't think best practice and a waste of time.
I have recreated this same process of adding a entity model in VS 2010 and it works 100%, where i have the ability to simply drop and drag from the dataSource toolbox
Maybe ill just wait for VS SP1 before working with it for client projects. :(
//Edit
If I add the ADO.net Entity model in VS2010 and then load the project in 2012 it loads fine in the dataSource toolbox. This is an answer but not an ideal work around.

While working on a project I recently faced the same problem. It took me about two days of extensive research but I think I've finally found it:
http://msdn.microsoft.com/en-us/data/jj556581
At least for me it solved the problem. Please let me know if it helped you..

Being addicted to L2S, I tried to get familiar with VS2012 and EF5. But I nearly lost my nerves trying to use the data sources toolbox.
Finally I found a solution:
using Object Data Source is now the recommended approach for using EF in databinding scenarios. See this article for more details - http://msdn.microsoft.com/en-us/data/jj574514. The article also includes a link to revert to the old code generation if that is what you desire.

Related

How to update gobuffalo models with pop?

I'm starting a project and already check how useful is gobuffalo/pop.
I have never previously used a framework for my GO projects. I just used the stdlib and I'm used to working with Django too.
In Django it is pretty straight forward to create/update a model and generate its migrations. It gets the current DjangoModel and generates a migration with the changes. What a surprise to me when I can't find how to do it with pop.
I already checked the documentation but I couldn't find any examples.
How do you do that?
Right now, you can only generate empty migrations and write them yourself: https://gobuffalo.io/en/docs/db/migrations#writing-migrations
There's an issue asking to implement a Django-like migrations generator (https://github.com/gobuffalo/pop/issues/184), but it's not done yet and requires a lot of work.

Is there any fastest method to update edmx?

I am using Sqlserver 2008 . I want to generate or update edmx. it take 8-15 minute to generate edmx. is there is any tool to create edmx fast?
I have a tool that works with VS2008, VS2010, VS2012, and VS2013, that can do both full and incremental updates of EDMX files. It doesn't work with VS2015 though, as development has been on ice for a while, and VS2015 don't support the same integration interfaces as previous versions of Visual Studio.
You can download it from https://huagati.com/edmxtools/ (free nowadays), and there's a screencast showing the functionality I think you are looking for at https://www.youtube.com/watch?v=doqYOlcEAZM
I don't know any way to generate EDMX model besides the "Update Model from database" approach. However, from my own experience, if your model is too big, you have 2 options:
Split your current model into several parts (Microsoft recommends 50 entities per model); or
Use Code-First instead of EDMX
Hope it helps!

Entity Framework 6, Postgres (npgsql) and EF Power Tools

I have some trouble using the EF Power Tools and I searched now for several days but I didn't find any solution for my problem.
Maybe someone has a new idea or hint for me. My problem is that when I want to create a Preview Data Model VS says that it couldn't find the required ADO.NET driver. I'm working with Postgres and EF 6.
It worked several days before but, as far as I can see within my source control nothing important changed. So I started to search for a solution and tried several things. I guess it has something to do with my app.config but I have no idea what I'm exactly missing there.
The app it self runs great and also the connection to the db works fine, only the EF power tools seems to have a problem.
It would be great if anyone could help me.
Regards Alex

EF 5 Update-Database Assistance

I am using Code First Data Migrations and have my development database so built up that I really don't want to start fresh again. I had deleted an old table and cannot get EF to accept any model changes due to this lingering phantom table. How can I get a clean version of my database context based on the model that's currently in place? Any help would be greatly appreciated!
You could use a "Code Second" approach and reverse engineer the model from the database. A good way to do this is to use the Entity Framework Power Tools for VS to do the reverse engineering. Once it is installed just right-click the project and select Entity Framework > Reverse Engineer Code First and select the relevant database in the dialog. This will generate a model in the Model folder.
I usually do this in a dummy project and then copy the files across. The model generation is actually very clean and adds some nice features like initializing ICollections to a new List in the constructor which are sometimes left out of the original Code First model.
EDIT
Here is an article which outlines the process using EF with an Existing Database

MVC 3 & ASP.Net with Entity Framework scaffolding error : No model classes are available

I am trying to use MVC3 with the Entity framework with Code First, but the code Template generation process in MS Visual Web Developer 2010 - is not detecting my Model in the models folder - giving a message - "No Model classes are available" - although I do have model classes for which I want to create controllers.
The templating option I've selected is "Controller with read/write actions and views using the Entity Framework".
I've uninstalled and reinstalled Web Developer 2010, but still having the same error.
Anyone know how I can get around this error?
xixonia's response worked for me. All I needed to do was build/rebuild the project and then everything worked as expected.
Rebuild all did not fix this issue for me... until I closed Studio, reopened and rebuilt all. Then it worked like a charm.
After create models must be build your project.
http://www.asp.net/mvc/tutorials/hands-on-labs/aspnet-mvc-4-entity-framework-scaffolding-and-migrations
I had this same issue and for me I had to go to the properties of the entity model in the entity model designer and change Code Generation Strategy to Default. It had been set to None because I had experimented with a DbContext generator.
I had this same issue.
While digging through my references, just before throwing the computer against the wall, I found that I had EntityFramework version 4.1 installed in the web project (by VS 2010 when the MVC 3 project was created).
I had 4.3.1 installed in the domain project (from nuget).
I uninstalled both of them and reinstalled from nuget.
Now everything is working again.
Hope this helps.
If you still have this problem then follow these steps to fix the problem:
1. Right click on your project and select [Manage NuGet Packages]
2. On the opened popup window, on the left hand pane, select Updates
3. On the right hand pane, at the very top right click on the Update All
During this process, it will ask you whether you want to overwrite the existing references (not sure about the exact phrase). So, say "Yes" to overwrite...
Now try to add the controller to your project and everything will be fine.
Good Luck!