objectcontext Questions

2

Solved

If you are using object contex data model (with EDMX file), during its creation you might want to specify the connection string inside your config file. The connection string is unfortunately not...
Pistoleer asked 7/8, 2012 at 7:7

4

Solved

Say you have code like this . using (CustomerContext db = new CustomerContext()) { var foundCustList=db.Customers.Where(c=>c.State=='-1').ToList();//Find all the customer which State is -1 fo...
Gaulin asked 14/12, 2012 at 6:30

1

Solved

Consider the following database table (SQL Server 2005). I'd like to use this in EF (v6, .net 4.5.1) with the Translate function but after searching seems this is not supported. CREATE TABLE Foo ...
Frampton asked 29/9, 2016 at 20:18

1

Solved

I have this simple LINQ query from e in Employees where e.DesignationID !=558 select e Here DesignationID is a nullable field: In objectcontext the query is translated to: SELECT [Extent1].[...
Radiotelegram asked 13/6, 2016 at 7:7

6

Solved

What is the best practice for working with entity framework in a multi threaded server? I'm using entity framework ObjectContext to manage all my database actions, now I know this context isn't thr...
Reindeer asked 23/2, 2012 at 15:26

4

Solved

Background Visual Studio 2012 NEW Model.EDMX file created in VS2012 Copied some of the EDMX xml from a previously created EDMX into the new one Problem / Question Now. The EDMX (TT transform, cus...
Overgrowth asked 25/10, 2012 at 18:0

1

Time once again to appeal to greater minds. I'm experiencing a very strange phenomenon. As the title states, I'm getting a NullReferenceException when trying to create an EF ObjectContext, but I o...

2

Solved

I am following the database approach first; I have created the tables in my SQL Server 2008 database, then I map those tables to Entity Framework classes using an ADO.NET Entity Data Model. But whe...

3

Solved

I'm using the DbContext class within code that I am creating that is based on the Generic Repositories and Unit of Work design patterns. (I am following the guidance here.) While working on this pr...
Atrocity asked 7/2, 2012 at 13:19

3

Solved

We are loading data from db: var somethings = Context.SomethingSet.ToList(); Then someone deletes or adds rows outside of context. Out context still has caches deleted object, because it doesn't...
Bartholomew asked 25/2, 2010 at 2:38

3

I'm trying to revert Context changes using the Context.Refresh method but It seems like Refresh is not a member of Context. I'm using the Microsoft ADO.NET Entity Framework 4.1 RC version. Any id...
Cynical asked 22/10, 2011 at 23:21

5

Solved

I've been stuck with this problem for over a week now. Hopefully some one can point me in the right direction. I start with a brief description of my schema. Asset 1--->1 Address *-->1 Area *-->1...

3

Solved

I have a new project created using Visual Studio 2013 with an ADO.NET Entity Data Model (EF6). Now I have to use some Dynamic Data function (like access to MetaTable object), so I add this code: ...
Humpbacked asked 11/12, 2013 at 15:27

1

Solved

I am using Entity Framework and calling a stored procedure as described here: http://msdn.microsoft.com/en-us/data/jj691402.aspx under "Accessing Multiple Result Sets with Code" After executing th...
Cynicism asked 23/2, 2013 at 7:33

2

Solved

I've been debugging this program without any result, and unfortunately I can't see the root of the problem. I get this exception: The ObjectContext instance has been disposed and can no longer be u...
Tripura asked 18/3, 2013 at 19:50

1

Solved

In my project I use entity framework 4.0 as ORM to persist data in a SQL Server. My project is a ribbon from application with a grid view and navigation tree in the main form with ribbon panel on...
Wristlet asked 7/3, 2013 at 6:57

1

Solved

I'm using the latest versions of ASP.NET MVC, SQL Server, and Entity Framework. I am not using code first. I can easily create an object context using the class generated by my EDMX file. But is ...
Endomorphism asked 27/1, 2013 at 22:48

1

Solved

I'm creating a delegate to retrieve all album records in the database. I've used this same way in another project, but for some reason I'm getting an error this time. Have I missed a step? I'm not...
Thickness asked 11/1, 2013 at 22:8

3

Solved

Ok, I'm obviously missing something very basic. I'm very new to Entity Framework. I want to call stored procedures without importing them, so I was planning on using ExecuteStoreQuery(). According...
Duwe asked 9/1, 2013 at 19:43

1

Solved

I try to add entity-framework to console application: I press "add new item" and then then then I added code: class Program { static void Main(string[] args) { try { Database...
Overweening asked 14/11, 2012 at 18:30

0

I use this code to add one item to a SpareParts table in my database. try { Database1Entities _db = new Database1Entities(); SparePart sparePart = new SparePart(); sparePart.manufactureID = 2;...
Trysail asked 14/11, 2012 at 15:24

1

Solved

Using EntityFramework, I have created an EntityDataModel (.edmx file) in App_Code\DAL. In the wizard, I named the entities 'DLGDBEntities'. I have a number of EntityDataSources in the .aspx where I...
Bova asked 8/11, 2012 at 3:45

1

Solved

I'm having trouble with one of my queries because of EF's change tracking and lazy loading features. The thing is that after I'm getting the result of the query, I'm using AutoMapper to map the dom...

2

Solved

I want to use ExecuteStoreQuery function of Entity Framework and I was wondered that my context variable didn't have ExecuteStoreQuery method. So, I discovered that it's a method of ObjectContext ...
Maleki asked 28/12, 2011 at 13:15

3

Solved

I'm having trouble with refreshing objects in my database. I have an two PC's and two applications. On the first PC, there's an application which communicates with my database and adds some data t...
Connected asked 1/4, 2010 at 23:29

© 2022 - 2024 — McMap. All rights reserved.