Entity Framework - Not able to add edmx file in MVC project - asp.net-mvc

I am using VS 2015 and created MVC project. Now I have created tons of edmx files with SQL server database but I am facing issue with MySQL database.
At certain point, wizard got disappear and not able to add edmx file to project.
In above picture, after selecting EF Designer from Db, I select connection.
then i come to this screen and as i press next button, it just got disappear and nothing is happening.
I dont know if its problem with VS 2015 or something else?
Really need help with this.

Related

ASP.NET MVC and Entity Framework5 - Adding a column to a table

I inherited an ASP.NET MVC project with Entity Framework 5. Since I don't know whether the project was created with a code-first or database-first approach, I went ahead and added a new column to the model and then I added the new column to the database table.
I modified the codes to utilized the newly added column. Every new entry added to the database contained the data for the newly added
column. Everything seems fine running locally using Visual Studio 2017.
On the server where the project was hosted under IIS web server there is something weird happened. The data for the newly added column was not available if I published the project using Release configuration but using Dev or QA configurations the data was there.
I am not sure how to fix the problem at this point and I can use your help.

Entities cannot be found after update edmx file

For the project I am working on, we have updated the database with two extra datatables that I now would like to add to the edmx file, but this gives an unwanted result.
What I do is open the edmx file, open the model Browser and run Update form database. In the wizard here I choose the two tables I want to add under the add tab and click finish.
The tables show up in the diagram view and in the Model browser under Model.Store-Tables/Views (and under Entity Types and EntityContainer). So far so good.
When I then save the changes to the edmx, all other existing entities,as well as the complete content of the Model.Context.tt file are deleted. The result being that the context entity and all underlying entities no longer can be found.
I do not understand why this is happening, and I don't know how to fix this and I am now stuck in the development of the project. i am using VS2015 and Entity Framework 6. I have spend most of the day to find a solution, but have not been able to do so. None of the "Entity can't be found" solutions around fixed my problem. I hope therefor that some smart minds here can help.
Thans!

App_Data folder is not checked in with Team Foundation Server [duplicate]

I am working with ASP.NET C# MVC 5.
.mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating the project a few times and none worked. What might be the cause for this?
Go to Team Explorer and locate Excluded Changes and you should find it excluded. Right click the App_Data folder and include it.
But you might want to reconsider including the database files. As you're developing and testing, every little database interaction will trigger a change and most of those are trivial. Also, if someone else is working on this project, they may not want your database file to overwrite theirs when they Get Latest Version.
If you're using Entity Framework Code-First, the database is automatically generated when you build the project I believe, otherwise you just run the Update-Database command to do it. This lets everyone collaborating have their own local database file to work with. You can also utilize migrations to make updates to the database structure. If you want the database to be generated with pre-populated data, you should utilize the Seed method.
This is a general question. As already answered by 'Ty Morrow' in above comment there is an initial Seed Method in Entity Framework which ensures that all values are inserted. However there are many scenarios that you also need to work with the latest added / removed DB entries not present in the seed method.
Please perform the following steps to ensure that your data directory file is included in the source control.
Click App_Data folder and on encircled toolbar click on Show All Files as shown below in the snapshot
Right Click on your MDF (Data Source) File and click on Include in Project
Right Click again on your MDF File and click on Include in Source Control
Simply Check in the file by Right Clicking on root project folder link and file show be now part of Source Control

Deleted .mdf file under App_Data in Visual Studio 2013. Now what?

I'm working on a small tutorial app using ASP.NET and MVC 5. I was finding that the database wasn't updating when I changed my seed data. Also, I put a breakpoint in the initializer class, and never hit it. I figured, well if I delete the database, then it will just get made fresh like it did when I first created it. Wrong. It broke the project. Same thing happened to this person.
What do I do now? Surely there is a way to get VS to create a new database.

MVC5 not generating Model from Database after NuGet update

I am creating an MVC 5 Web Application with Visual Basic using Database First Approach. Recently I updated ALL NuGet packages and after that I'm unable to create Models from the Database.
As shown below, I can not select Tables and other DB objects from Database to include in my Model.
When I click finish, it generates an empty model as shown below:
One more weird thing I noticed is: As shown in this tutorial, it should show me a checkbox that says, Enable Extended Transact-SQL verification for common objects, but when I open the properties of my project, it doesn't show me this checkbox.
Now, my questions are:
If as I doubt, a NuGet package update has created this problem; which
package is it?
Is it possible to uninstall updates of NuGet packages
(as we do with Windows Updates)? If yes, How?
Any help would be appreciated. Please note that,
I've experience in Web Forms but I'm a beginner in MVC.
This issue
has started just after, I updated ALL packages when I was facing
this type of issue.
I created 3 projects with the same approach
before this update, and I succeeded every time generating the Models
from Database.
Please suggest!
Right click the .edmx file in the solution explorer and select 'open with..' Select the XML editor and open the file. Check if there are any errors in the file. Errors may show in the error list window or may show as comments in the file.

Resources