Tag: entity-framework

54 votes
17 answers
1K views
Entity Framework: There is already an open DataReader associated with this Command

I am using Entity Framework and occasionally i will get this error. EntityCommandExecutionException {"There

avatar
Suzan
0 1 0 9
asked 07 September, 2021
62 votes
23 answers
2.2K views
Entity Framework. Delete all rows in table

How can I quickly remove all rows in the table using Entity Framework? I am currently using: var rows = from o

avatar
Boyd
0 1 0 9
asked 07 September, 2021
55 votes
17 answers
1.9K views
Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework

I want to save my Edit to Database and I am using Entity FrameWork Code-First in ASP.NET MVC 3 / C# but I am g

avatar
Scot
0 1 0 9
asked 07 September, 2021
65 votes
21 answers
1.8K views
The term "Add-Migration" is not recognized

I'm using this MSDN Tutorial to run in VS2015 the command PM> Add-Migration MyFirstMigration -context

avatar
Hallie
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1K views
Entity Framework Core: DbContextOptionsBuilder does not contain a definition for 'usesqlserver' and no extension method 'usesqlserver'

I am new to EF core and I'm trying to get it to work with my ASP.NET Core project. I get the above error

avatar
Venice
0 1 0 9
asked 07 September, 2021
52 votes
18 answers
2.8K views
How to unapply a migration in ASP.NET Core with EF Core

When I run PM> Remove-Migration -context BloggingContext in VS2015 with an ASP.NET Core project using EF Co

avatar
Scot
0 1 0 9
asked 07 September, 2021
52 votes
14 answers
1.6K views
Command dotnet ef not found in .NET Core 3

I'm following the docs in order to create an initial migration. When I execute dotnet, I get the help sec

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
60 votes
18 answers
834 views
"Items collection must be empty before using ItemsSource."

I'm trying to get images to display in a WPF ListView styled like a WrapPanel as described in this old AT

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021