Questions tagged [ado.net-entity-data-model]

Covers the Entity Data Model-part of ADO.NET

Covers the Entity Data Model-part of ADO.NET

505 questions
5
votes
1 answer

EntityFramework 4.0: InvalidOperationExeception: Multiplicity constraint violated

We have recently upgraded our software to .NET 4.0 and EF 4.0 (without self-tracking entities) (former .NET 3.5 SP1). Now a new exception is raised in former working code, which we do not understand. We have an entity called Resident, and another…
JanW
  • 1,799
  • 13
  • 23
5
votes
1 answer

No Entity Data Model option in Data Source Configuration Wizard

I am using Visual Studio 2013 [Ultimate] and I want to develop a database application using Entity Framework. I have just created a Windows Form application. When I try to add a new data source I have no "Entity Data Model" option but only "Dataset"…
5
votes
1 answer

Update A Collection With Entity Framework

I have a detached set of client objects that I'd like to update (I know they already exist in the db by primary key). Now I want to update them to the database. Knowing I need to query them first, I do so and now have to basically take the…
RailRhoad
  • 2,128
  • 2
  • 25
  • 39
5
votes
2 answers

Quickly Testing Database Connectivity within the Entity Framework

[I am new to ADO.NET and the Entity Framework, so forgive me if this questions seems odd.] In my WPF application a user can switch between different databases at run time. When they do this I want to be able to do a quick check that the database is…
Rodney S. Foley
  • 10,190
  • 12
  • 48
  • 66
5
votes
1 answer

OData without IQueryable

I’m thinking of using OData for my web service (based on Web API). Unfortunately, my datasource is NOT IQueryable. Instead of implementing my own IQueryable I pretty much followed this blog post. What I don’t understand is how to get to my entity…
Dunken
  • 8,481
  • 7
  • 54
  • 87
5
votes
0 answers

ADO.Net Entity Data Model Designer: Disable auto-layout?

ADO.Net Entity Data Model Designer (VS2010) is making me INSANE -- hopefully someone has dealt with this and knows how to make it stop. When initially putting together a complex data model, it's perfectly fine that Designer figures out on its own…
DanM
  • 7,037
  • 11
  • 51
  • 86
5
votes
2 answers

How can I convert an ObjectResult to IQueryable?

I'm using entity framework in an asp.net mvc 3.0 application. I'm using a table-valued function to do a full text search on one of my database tables. I have set the return type to an object of type Request. Then I feed the results into an…
5
votes
1 answer

Using a webservice as datasource for an ado.net entity data model

i am currently trying to use a webservice as the source for an ado.net edm. For example: http://odata.netflix.com/v2/Catalog/$metadata I have the xml of the webservice already stored in a variable, so that i can use it, if necessary. Is there any…
5
votes
2 answers

Entity Framework - "The relationship between the two objects cannot be defined" error, but I think I'm using the same context

In my ViewModel I have some code like that: public class OrderViewModel { private UserOrder order; private DeliveryCentre deliveryCentre; // This is my EF Container private CatalogueContainer catalogue = new CatalogueContainer(); …
glenatron
  • 11,018
  • 13
  • 64
  • 112
4
votes
2 answers

System.InvalidOperationException: Mapping and metadata information could not be found for EntityType

I have an ASP.NET 4.0 web application that uses Entity Framework 4.3.1 and Self-Tracking Entities. It works fine until I add another ADO.NET Entity Data Model (.edmx) file to it. After that the project compiles without any errors, but as soon as it…
4
votes
2 answers

MVC3 with Npgsql and Entity Framework and .Net Framework 4

Well I would like to know if NpgSQL supports .NET framework 4 with EntityFramework, as I tried to use it with framework 4 and Microsoft.Data.Entity.CTP (code first approach) in my MVC3 application and I found no success unfortunately. Also if any…
4
votes
1 answer

How do I pass a connection string to the constructor of a database-first DBContext with Entity Framework 4.1?

For various reasons I would like to not store the connection string for my Entity Framework DB model in one of the various .config files. (I am using the latest and greatest DBContext API with the new Entity Framework version 4.1, .NET 4 and Visual…
4
votes
1 answer

Entity Framework - Stored Procedure result as an entity without Primary Key

Please forgive me if this question has been asked and answered already. If so, kindly point me to it. I'm using VS2010 over .Net 3.5 (platform update not in my control) with up-to-date Service Packs. I have a stored proc that will return rows like…
4
votes
1 answer

Entity Data Model - export to other solutions in visual studio

a newbie question here... I've created an entity data model (.edmx) file in one project and now it's sitting there looking beautiful with complex types defined and diagrams all spaced properly.. Then I started a new project and try to reuse the same…
4
votes
2 answers

C# .Net MVC An object reference is required for the nonstatic field, method, or property

I'm a junior in C# and I cant find the solution using search I have a database model (EDM) I have a created a class file in models folder: using System; using System.Collections.Generic; using System.Linq; using System.Web; using…
Evgeniy Labunskiy
  • 2,012
  • 3
  • 27
  • 45