Entity Framework version 6.1.3 not getting open - asp.net-mvc-4

I am building an empty MVC application using .net 4.5 framework VS 2012. Then I add entity framework version 6.1.3. After adding I right click on the models folder to add a new entity model. It opens the entity data model wizard where I am selecting "Generate from database". Then it is taking me to choose your data connection , but after a while its automatically closes. I don't know where's the problem is exactly. In web.config file I also changed the entity framework version from 6.0.0.0 to 6.1.3.0 , still it is getting close and not allow me to select my database. I tried EF version 4.0 and 5 as well but the same problem . I have one existing application on VS 2012 with EF version 4.4.0 , where some databases are already there. I have tried adding one more database there and it is adding there. then why not adding on my new application having the same configurations. What would be the problem ? Any help would be very much appreciated.

finally I found the answer after working around it for hours. what we need to do is , Go into view->Server Explorer and remove any "Data Connections". Then this worked again.

Related

.net core 3.0 Auto migration does not create/update/ datatable automatically

I am building a project template using .net core 3.0 and Microsoft.EntityFrameworkCore.
this will just created the database schema not the data table
if (!context.Database.EnsureCreated())
context.Database.Migrate();
Do we have an automatic migration that helps to create/update datatable without needing to manually call
Add-Migration
Update database
I was able to build it automatically in .net using Code base EF6, it will just detect if you have created a new field in the model and add it to database automatically.
Do we have something in .net Core ?
Thanks
Do we have an automatic migration that helps to create/update datatable without needing to manually call Add-Migration Update database
As far as I know, automatic migration feature has been removed in EF Core.
And DbContext.Database.Migrate(); just help apply any pending migrations for the context to the database, which mean that we should created migration(s) first otherwise it would not work.

Failed to find or load the registered .Net Framework Data Provider (VS2005)

I am editing some existing code, and as part of the changes I need to add a column to each of two datasets (.xsd in Visual Studio Solution Explorer).
One worked fine - open the designer, right-click, add column.
The second gives the following error:
"Failed to add column. Failed to find or load the registered .Net Framework Data Provider."
As these are both in the same project, I'm confused as to why this one is failing when the other is not.
The only difference I can think of, is that the one that works is selecting from the database directly (SELECT ... FROM TABLENAME); whereas the one that fails is selecting from a database function (SELECT ... FROM dbo.FunctionName(#param) AS ALIASNAME)
Wherever I've looked, people suggest it's an error with the .settings / .config files; but because one works and one fails, I can't see how this can be an issue with references?
This is in a standard vb project in VS2005, that compiles to a DLL - so it's not asp.net.
--Edit--
Right-click, Preview Data also gives the same error.
--Edit2--
When I try and Add a DataSource, I get the following error:
This SQL Server version (10.50) is not supported.
I have SQL Server 2005, and SQL Server 2008 R2 installed, both with latest service packs.
I tried two things simultaneously, and one of them worked:
I installed the following patch from Microsoft: https://www.microsoft.com/en-us/download/confirmation.aspx?id=15680
I rearranged my machine.config file (SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config), so that in the DbProviderFactories section the one I am using is at the top of the list.

app.config “Could not find schema information” after converting to Visual Studio 2010 / .Net 4.0

i am working on vb .net project. it was working fine till yesterday. i m trying to build it today but its giving me following build errors.
1 Could not find schema information for the element 'supportedRuntime'.
2 Could not find schema information for the attribute 'version'.
3 Could not find schema information for the attribute 'sku'.
i tried few things but it is not working fine. I tried selecting the DotNetConfig.xsd from the properties of app.config. it didnt work. I chose some other schema then it is selecting both the schemas. and throwing some other bunch of errors too. I tried killing the process from the task manager. i tried replacing the app.config.
What should i do?
P.S: i am using visual studio 2010 version.
and .net framework 4.0
Close the solution, then re-load it and Rebuild

Visual Studio 2013 SQL Query and View Designer not appearing

Not sure why the Query and View Designer is not appearing as per
http://msdn.microsoft.com/en-us/library/vstudio/ms172013.aspx
It's an ASP.net project with database in the AppData folder, and a connection using SQL 2008 Express.
If it helps the connection string is:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\folders...\App_Data\database.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True
If I open the project in VS2012 (where I've worked on this project for some time), find a table, right click, new query, I get the nice interactive visual design tool.
If I open the project in VS2013 (just installed) and do the same, blank page named SQLQuery1.sql and a basic connection to SQL Express (ie. master, model, etc.)
MS page tells me Tools / Options / Visual Database tools - but this doesn't exist on my installation!
Am I missing something?
Also tried with blank project, added App_Data and a new database (so using LocalDB), added a table, right click, new query - exactly the same blank file.
I have been having the same problem and think I have found the solution.
When you are adding the connection to the Database, in the Add Connection Dialog.
Click 'Change...' next to the Data source
Dialog opens showing 'Change Data Source'
You probable have selected 'Microsoft SQL Server' and then below that there is a drop down where you can select:
.NET Framework Data Provider for OLE DB
.NET Framework Data Provider for SQL Server (This is probably selected by default)
try changing to the OLE DB connection.
Click OK, and then complete the rest of the connection on the 'Add Connection' dialog.
I have then found that using the database works as it did in VS2012 and as you are describing above.
Was searching for a solution to a similar issue. Unable to use Query Designer for a local mdf file database. This is what I found...hope it helps someone.
Reading the comments here (http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ed4675d3-aa84-47db-bdf5-f852355409e6/query-designer-not-displaying-in-visual-studio-2013?forum=ssdt).
According to the moderator of that forum question (Kevin Cunnane of Microsoft), "in Visual Studio 2013 the query designer and database diagram features are no longer available from the Server Explorer. If you wish to keep using the query designer, the only other workaround for now is to access it from SSMS. "
My current workaround is to use Visual Studio 2012 Server Explorer to view data and write queries for a local MDF file. And to use Visual Studio 2013 for everything else.
I have researched about 5 minutes how to run a query in Visual Studio. At the end I found this:
Even though i followed same steps , It did not work at once it gave some error and Studio closed. It was problem at my end and unknowingly it got sorted out on its own.
This component is called "SQL Server Data Tools". You can download it from MSDN. I found this page simply by googling "vs2013 ssdt". It seems that what TsugaSoft posted is true, however you still can install this component separetely... And it also works for Visual Studio 2012.

Entity Framework migration with already deployed SQL compact database

My situation: EF 4.3, private install of SQL Compact 4, .Net FW 4, c# winform
Problem: after the application was deployed there was the inevitable change requested that required me to create a new field in the only table in the SQL compact database. During app install the SQL compact db is placed in the user's Application Data folder so that it can be written to successfully. I updated the program and redeployed but the following behaviors are occurring:
uninstalling the old version of the app does not uninstall the SQL compact db in the user's Application Data folder
installing the updated version of the application does not overwrite the old SQL Compact db in the user's Application.
Since the new database with the added column doesn't get copied over it is breaking the application when the user runs it. My reaearch indicates that I should be using "automatic EF migrations" to solve my problem. In my situation mydesired strategy would be to do a quick check of the db table and add the missing column if necessary.
I am using EF the Database first way. I am having a hard time finding a good example that fits my situation and my desired strategy for fixing this.
Any help would be greatly appreciated! :-)
I don't think EF Migrations have anything to do with your problem. According to this, if you follow ClickOnce tutorials step by step, it should work. As suggested by that SO answer, you should check this page. Good luck!