3
голосов
1ответов
2186 просмотров

How do I delete one or more rows from my table using Linq to Entities *without* retrieving the rows first?

I understand I can map a delete stored procedure to the delete method for a particular type. However, this requires passing in a retrieved object to my context's DeleteObject method. This is bad enough, but what if I want to delete 2000 rows? Can I do this with Linq to Entities without first re...

2
голосов
2ответов
1522 просмотров

Why is Entity Framework ignoring the Take() method when generating SQL?

I am using the .Skip and .Take methods with Entity Framework. The .Skip call is being honored when generating the SQL. The .Take is not. This code: public IList<DocPullRun> GetDocRunsPaginated(int startRowIndex, int maximumRows) { Logger.Debug("GetDocRunsPaginated: star...

0
голосов
1ответов
469 просмотров

TM1 API for LinqToEntities

IBM Cognos TM1 is a multidimensional database that my company thinks is the latest and greatest. I've been to the classes and, sure, it is nice for analysis. Of course the finance people in my company only see the Excel Add-In or Excel-like website and think "that's all I need for a data entry ap...

0
голосов
1ответов
268 просмотров

How does the Entity Framework and the LINQExtender project differ?

I have used LINQ-to-SQL in WPF and ASP.NET MVC projects in the following way: create database drag tables into the designer use generated classes with LINQ Now I have a project where the data sources are a mix of web services, a database, and XML files. From what I understand of Entity Framew...

5
голосов
2ответов
7002 просмотров

Can Entity Framework deal with multiple result sets (each from joined tables) from a stored procedure?

In Linq to SQL, I can't find an easy way to deal with multiple result sets returned by a stored procedure where each result set is from table joins. Each result set does not map directly to a table. (can't change this behavior). For now, it seems using a DataSet is a lot simpler. Can the current...

0
голосов
3ответов
1547 просмотров

How can I get an instance of a base class from an inherited class dynamically?

I've got a class public class foubar : fou fou has its properties and so does foubar I've created an instance of foubar and set values to all the properties including the base classes'. Now I need an instance of fou that has the property values that are in foubar. True, I could create a new inst...

0
голосов
2ответов
167 просмотров

How to categorize SQL Server data access for papers?

We are writing this paper about database access in a web app and have to distinguish between the different categories of the database access layer. All books and PDF's given us provide only information to JDBC or OLEDB. Researching on the web brought me to the point that access to a Microsoft S...

4
голосов
1ответов
1299 просмотров

Consuming Service Operations of an ADO.NET Data Service from a .NET Client

I am trying to build an ADO.NET Data Service with lots of entities and a few service operations. On one side I created a ASP.NET Web Application, in which an ADO.NET Entity Data Model and an ADO.NET Data Service are located. On the other side I created a second ASP.NET Web Application that has a ...

4
голосов
1ответов
1329 просмотров

Linq to Entities and Xml Fields

I have this scenario: A SQL Server table myTable with field1, xmlField (nvarchar(50) and xml sql server data type) Linq to entities Now I'd like to get a query like this: SELECT Field1, XmlField FROM MyTable WHERE CAST(XmlField AS nvarchar(4000)) = '<myXml />' Obviously this is a cor...

1
голосов
4ответов
265 просмотров

In terms of performance, which is faster: Linq2SQL or Linq2Entities (in ASP.net MVC)

Comparing the two data models in an asp.net MVC app, which provides better performance, LINQ 2 SQL or LINQ 2 Entities. They don't always perform the same database operations when you use the same methods, or have the same LINQ methods for that matter....

0
голосов
1ответов
498 просмотров

Trying to use linq to search based on table with hierarchical data

Duplicate many times over (and also these) I have a table called Types that has the following columns. ID Level Name ParentID (The ID of the parent row) and a table called ParentObject which has the following columns. ID TypeID there are 4 different level (possibly to be expanded to more). S...

0
голосов
1ответов
666 просмотров

why the session to sql server is out at this case?

I used linq to entites to connect to database, and recently i found the following problem, when i open the website and login, and and I leave the page idle for around 10 minutes, the click the link in the website which make a connection to database. But it seems that the connect to sql server 200...

0
голосов
1ответов
299 просмотров

How can I get my table back after I remove it from my EDMX file in Linq-to-Entities?

I am having trouble with my Linq2Entities model - I might be missing something obvious here. Here is what I did: Added an EDMX model file Added TableX to the model Went back to SQL Management Studio and updated TableX, changing its primary key Went back to my EDMX file and click "Update Model ...

1
голосов
1ответов
6665 просмотров

Entities: Adding a Navigation Property between a View and Table

As you can seen in the diagram below there is a one-to-many relationship between the ProjectTask and Dependency table. Entities tries to map every field in the View to fields in the Dependency table, which wouldn't work. Any suggestions on how I can add the navigation property? Thanks, Abe ...

0
голосов
2ответов
963 просмотров

Iterate through data returned from var to get names and values of columns

I am using Linq to Entities in a method and returning specific columns of data from the method. I don't know what type I'll be returning so I rigged it to return a List. If someone knows a better way than the way I rigged it, PLEASE let me know. See the code below. After returning this data...

0
голосов
2ответов
630 просмотров

Linq to Entities query hitting db twice

I have the following pretty simple linq query querying a linq to entities edmx. (from i in ent.Inspectors select i).OrderBy(s => s.Surname).Skip((page - 1) * count).Take(count).ToList(); In Sql Server Profiler I can see that the exact same select query is being sent twice. Can someone expl...

0
голосов
2ответов
124 просмотров

proper way of doing a left join with linq to entity?

since DefaultIfEmpty() is not supported, what is the proper way of doing a left join?

1
голосов
2ответов
380 просмотров

From old DataLayer to LINQ to SQL / Entity Framework

There are a few "should I chose this or that" questions on SO and Google, as well as a lot comparing LINQ2SQL and LINQ2E. I've seen drawbacks, differences, cons, pros, limitations, etc. I cannot say I'm an expert but I'd like to know "what would you do" if you faced this scenario and why. I hav...

5
голосов
6ответов
738 просмотров

Is it a bad idea to jump into LINQ to SQL now?

I have been using ADO.NET in favor of LINQ to SQL (or Entities) up to this point. I'm starting a new project that should be smallish, at least at first but I would like to have room to expand down the line. I feel now is a good time to get into LINQ. I've avoided it for quite a while; however,...

11
голосов
3ответов
1424 просмотров

Why Does the Entity Framework make so Many Roundtrips to the Database?

I am rewriting my application to use the entity framework. What I am confused about is the code I am writing looks like it is making unnecessary tripts the the sql server. For example, I have a question answer site similar to SO. When I add an answer to a question -- here is the code I use: var ...

0
голосов
2ответов
874 просмотров

EntitySQL -- Object reference not set to an instance of an object

I am getting this error when I try to do an insert on a column that is a foreign key. Here is how I am assigning the value var at = MvcApplication1.Entity.alttitles.Createalttitles(0, altTitleText); at.question.question_id = questionid; //Error here at.userinfo.user_userid = _A...

5
голосов
5ответов
11196 просмотров

Linq to entities Left Join

I want to achieve the following in Linq to Entities: Get all Enquires that have no Application or the Application has a status != 4 (Completed) select e.* from Enquiry enq left outer join Application app on enq.enquiryid = app.enquiryid where app.Status <> 4 or app.enquiryid is null Ha...

1
голосов
1ответов
893 просмотров

Linq to EF Expression Tree / Predicate int.Parse workaround

I have a linq Entity called Enquiry, which has a property: string DateSubmitted. I'm writing an app where I need to return IQueryable for Enquiry that have a DateSubmitted within a particular date range. Ideally I'd like to write something like IQueryable<Enquiry> query = Context.Enquir...

1
голосов
2ответов
1769 просмотров

Linq to Entities - Delete from a link / junction table

I'm building an ecommerce site with products being in multiple categories. As a result of this I've got a Products table, a Categories table and a ProdCat linking / junction table that contains all the productId / CategoryId combinations. When performing an update using Linq To Entities (which I...

3
голосов
3ответов
336 просмотров

Does Linq to Entities 4.0 have Fulltext capabilities?

Just wanted to know if Linq to entities 4.0 have fulltext search capabilities? Thanks

116
голосов
14ответов
138027 просмотров

How to compare only date components from DateTime in EF?

I am having two date values, one already stored in the database and the other selected by the user using DatePicker. The use case is to search for a particular date from the database. The value previously entered in the database always has time component of 12:00:00, where as the date entered fr...

0
голосов
2ответов
973 просмотров

Linq to Entities and SQL Server 2008 hierarchy id

Does Visual Studio 2008 SP1 / .NET 3.5 support Linq to Entities (ADO.NET Entity Data Model / edmx) with SQL Server 2008 R2? Specifically, the hierarchy id type? If so, do you have a download link, if not is there a published date when this feature will become available? I experimented a bit to...

3
голосов
1ответов
544 просмотров

Has Microsoft Fixed Linq to Entities Performance Problems in .NET 4.0?

I feel pretty comfortable with the entity framework now. I have been reading some performance articles on the Linq to Entities performance issues. Are these issues still present in .NET 4.0?

1
голосов
1ответов
49 просмотров

I need to confirm this about linq to sql/entity

if you have something like(just an example don't worry) var result = from n in mytable select n; var last = n.LastOrDefault; var secondresult = n.FirstOrDefault; var Thirdresult = secondresult.FirstOrDefault; var Finalresult = Thirdresult.FirstOrDefault; is this will query the database 5 times?

3
голосов
2ответов
976 просмотров

What is the difference between LINQ to Entities and the Entity Framework?

Simple question: What is the difference between LINQ to Entities and the Entity Framework? Up until now, I thought that both were different names to describe the same query, but I'm starting to get the feeling that it's not.