entity-framework

Strange error after adding a table to Entity Model

I have a customised dynamic data application based on an Entity Framework model. The application compiles and runs fine, until I open the model and add a single, simple table. As soon as I add this table, I get the following error on all my tables: Must specify mapping for all key properties. Key properties are and have been properly...

Customized mapping in poco of Entity framework

Sometimes i would like to serialize dynamic properties to one field in database and lazy deserialize field to dynamic properteis in object view, see following in object view: public IDictionary<string, string> _properties; public IDictionary<string, string> Properties { get { if (_properties == null) { ...

Dataset and SQLCe in .net 4

I'm trying to build a SQLCe table structure dynamically using a dataset as the temporary table structure... Is there a SqlConnection string that will work with SqlCe? There used to be a SqlCeConnection...but I don't find that in the 4.0 framework? Has something replaced this? If the answer is L2S or Entity Framework...can I add colum...

Handling View Relationships in the Entity Framework

We have a set of views (quite a few) that we're trying to implement in the Entity Framework with their relationships. These views have primary keys defined but for some reason when I create an Entity model for them I received the message: The table/view 'vwFoo' does not have a primary key defined. The key has been inferred and th...

Linq to Entities: How do I pass an IQueryable to a Method

I am really baffled on this one. I am trying to pass my posts vaiable to a method. How do I go about doing this: var posts = from p in context.post where (p.post_isdeleted == false && (object.Equals(p.post_parentid, null)) select new { p.post_date, p.post_id, ...

How to call operations other than CRUD in RIA Domain Service?

I have some trouble getting my head around how to implement more complex operations in a Domain Service in RIA Services. This is all Silverlight 4, VS 2010 and .Net Framework 4 in Beta 2. Goal I wish I could create an operation on my LinqToEntitiesDomainService that would have a signature something like this: public UnwieldyOperation...

How to do a "join" in a LINQ query against the Entity Framework

I have the following table structure which has been imported into the Entity Framework. I need to write a LINQ query where I select the entities of Table1, where a field in Table2 is equal to true, and a field in Table 3 is equal to a specific GUID. Could someone help with this? Thanks you. ...

ADO.NET Entity Framework ObjectContext - Caching Question

I was wondering if it was wise to cache the Entity Framework's ObjectContext object in the Cache; will this give me issues with multiple connections at the same time that the user will experience issues with that? I've gotten errors like: 'connection is currently closed' and wondered if that was due to multiple users and caching the Obj...

Auto generating metadata classes for Entity Framework

I am considering using xVal for validation of Entity Framework classes in a MVC application. This involves writing metadata classes as explained in details by Graham O'Neale (http://goneale.com/2009/03/04/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework). I am wondering if there's a way to auto generate such metad...

Does EntityFramework work against an Access 2007 db (.accdb)?

I'm trying to create an MVC application that uses an Access 2007 DB (.accdb). I can create the Model using DataSet. But if I try to create a Model using EntityFramework, I can't get past VS2008 wanting to make the connection string be a SQL server. Am I missing something, or does EF not play with Access? ...

Can I refactor a range variable in a linq statement?

I have an entity framework 3.5 project where I'm using TPH inheritence. Two of my concrete types are in their own DAO class and contain a selector that projects the Entity Class into a DTO. However, both of these concrete classes have similar relations with another table which I use a let statement to identity clearly. My question is,...

UpdateException with ADO.NET and SSCE

Sorry, I was typing this up on my iPhone really fast. I have a SSCE database that has two tables (EDMX). I am using the repository pattern and the Entity Framework to communicate between my application and the SSCE. But I get an XamlParseException that is hiding an UpdateException. It always seems to stop when I call entities.SaveChanges...

Using Entity Framework with an SSAS Cube

Is it possible to use Entity Framework (any version, including, and preferably 4.0) to query an SSAS cube (preferably SSAS 2008)? ...

Unable to create objet context

I'm getting the Unable to create object context error when using Entity framework in ASP.NET MVC. Background Every time I POST to the controller I'm not getting a response back. I tried going directly to the method of the controller /Data/GetAll, and receive this error: Error The specified named connection is either not found in...

Entity Framework in .NET?

Do we need to install the entity framework separately or does it come with .net 3.5 ...

Issue with materialized query result - LINQ

I have a List that includes IQueryAble inside as a property. I'm passing List to my View in MVC project. I iterate through the List using foreach. Inside the foreach: Albums in type of List <% foreach(var x in Albums){%> <h1><%= x.Title %></h1> <p><%= x.Photos.Count() %> </p> <%}%> Displaying the Title is not an issue, but it thro...

What are the major differences between Data Access Application Block, NHibernate, ADO.NET Entity Framework and LINQ to SQL?

What are the major differences between Data Access Application Block, NHibernate, ADO.NET Entity Framework and LINQ to SQL with respect to performance, business logic, scalability and flexibility? ...

How can my application use both an MS Access database and a SQL Server database at the same time?

What strategies and techniques have you used to produce a data driven application that needs to access multiple diverse data sources? Specifically, Microsoft Access and SQL Server. Ideally, I'd like to make an abstraction layer that hides the physical data source from the application. Something like the ADO.NET Entity Framework would ...

Entity Framework and Link Table issue

Hi, I have a database which consists of the following: ** Table 1 ** Id (PK) Field1 ** Table 2 ** Id (PK) Field2 ** Link Table ** Table1Id (FK) Table2Id (FK) The problem is, I cannot access Table 2 from Table 1, even though the relationship exists in the database. For example, the following should be possible: var Results...

Entity classes created using ADO.NET Entity Framework?

What is the type of Entity classes created by the Entity Framework which map to the database tables? Are these classes like the classes created using the LINQ to SQL designer and are defined as "partial classes" ...