Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 3 years ago. Improve this question How would you rate each of them in terms of: Performance Speed of development Neat, intuitive, maintainable code Flexibility … Read more

Entity Framework Provider type could not be loaded?

I am trying to run my tests on TeamCity which is currently installed on my machine. System.InvalidOperationException: The Entity Framework provider type ‘System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ for the ‘System.Data.SqlClient‘ ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.. I have no … Read more

Entity Framework – Include Multiple Levels of Properties

The Include() method works quite well for Lists on objects. But what if I need to go two levels deep? For example, the method below will return ApplicationServers with the included properties shown here. However, ApplicationsWithOverrideGroup is another container that holds other complex objects. Can I do an Include() on that property as well? Or … Read more

EF Migrations: Rollback last applied migration?

This looks like a really common task, but I can’t find an easy way to do it. I want to undo the last applied migration. I would have expected a simple command, like PM> Update-Database -TargetMigration:”-1″ Instead, all I can come up with is: PM> Get-Migrations Retrieving migrations that have been applied to the target … Read more

Unable to update the EntitySet – because it has a DefiningQuery and no element exist

I am using Entity Framework 1 with .net 3.5. I am doing something simple like this: var roomDetails = context.Rooms.ToList(); foreach (var room in roomDetails) { room.LastUpdated = DateTime.Now; } I am getting this error when I try to do: context.SaveChanges(); I get the error: Unable to update the EntitySet – because it has a … Read more

No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’

After downloading the EF6 by nuget and try to run my project, it returns the following error: No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’. Make sure the provider is registered in the ‘entityFramework’ section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. 35 s 35

Code-first vs Model/Database-first [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question What are the pros & cons of using Entity Framework 4.1 Code-first over Model/Database-first with … Read more

SqlException from Entity Framework – New transaction is not allowed because there are other threads running in the session

I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session. while running this code: public class ProductManager : IProductManager { #region Declare Models private RivWorks.Model.Negotiation.RIV_Entities _dbRiv = RivWorks.Model.Stores.RivEntities(AppSettings.RivWorkEntities_connString); private RivWorks.Model.NegotiationAutos.RivFeedsEntities _dbFeed = RivWorks.Model.Stores.FeedEntities(AppSettings.FeedAutosEntities_connString); #endregion public IProduct GetProductById(Guid productId) { // Do a quick sync … Read more

MetadataException: Unable to load the specified metadata resource

All of a sudden I keep getting a MetadataException on instantiating my generated ObjectContext class. The connection string in App.Config looks correct – hasn’t changed since last it worked – and I’ve tried regenerating a new model (edmx-file) from the underlying database with no change. Anyone have any ideas? Further details: I haven’t changed any … Read more