linq-to-entities

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 ...

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 from Database" TableX updated but incorrec...

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 2005 is out, and it will automatically reconn...

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). So if I had ID: 1 Level: 0 Name: Level0 Pa...

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.... ...

Linq to Entities and Xml Fields

Hi to all. 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 correct query in SQL Server but I can't...

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 Service Reference to the Data Service. En...

How to categorize SQL Server data access for papers?

Hello everybody! 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 SQL Server trough linq-to...

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 instance of fou and write code that would popu...

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 Entity Framework or the upcoming one, 4.0...

Where does EF store the mapping view, in MetadataWorkspace, EntityConnection or in ObjectContext and is it worth it to pregenerate views?

I am currently transitioning an application over from LINQ-to-SQL and I've been running into a problem. LINQ-to-SQL offered a way to query any Table/Column-attributed type (which was the default mapping model) through any DataContext through the GetTable<T> function, which analyzed the type and then created the appropriate SQL. Even th...

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 Framework, I can create similar classes as I can...

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 application!" My response is "I thought you ...

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: startRowIndex: {0}, maximumRows: {1}", startRowIndex...

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 retrieving those 2000 rows from the database...

RIAServices unsupported types on hand-built DomainService

My EF model was generated from my SQL Server database. I then generated a DomainService for RIAServices against the EF model. One of the entities is called "EntryCategories". The DomainService created this method: public IQueryable<EntryCategories> GetEntryCategoriesSet() { return this.Context.EntryCategoriesSet; } Since my user i...

Search Database using a collection of entity objects

I'm sure this is straight forward but I'm very new to entity queries and has probably been asked before. What i need to to search for all business in my database where they have a category that exists in a collection of categories I have built up IList<businessCategory> busCatList; busCatList.Add(businessCategory.CreatebusinessCategor...

How to do a Bulk Insert -- Linq to Entities

I cannot find any examples on how to do a Bulk/batch insert using Linq to Entities. Do you guys know how to do a Bulk Insert? ...

Complex string matching with LINQ to Entity Framework

We are using LINQ to EF to develop a solution. In my LINQ query I would like string toMatch = "Matt Cool"; newString = toMatch.Replace(" ", "% ") + "%"; // So here newString is 'Matt% Cool%' /*Now in my datasource, there is no 'Matt Cool', there's 'Matthew Coolguy'. I would like this query to return that result. I would expect th...

ASP.NET MVC: Strange typecasing error ....

Strange typecasting error: System.string -> weekmenu.SimpleTable Controller Function Index() As ActionResult ViewData("ListFrontName") = WeekMenuRepository.ListFrontName() ViewData("ListLastName") = WeekMenuRepository.ListLastName() Return View() End Function WeekMenuRepository Public Function ListFrontName() Implement...