Questions tagged [entity-sql]

Entity SQL is a storage-independent query language that is similar to SQL.

Entity SQL is a storage-independent query language that is similar to SQL. Entity SQL allows you to query entity data, either as objects or in a tabular form.

98 questions
1
vote
0 answers

Entity SQL reference to the created model in C#

I am trying to follow a textbook tutorial, I create the model but I don't know why I cannot reference to it. Anyway, in collusion when I try to read the data from the database I get an exception, saying that the table was not found. Thank you for…
Doro
  • 671
  • 1
  • 16
  • 34
1
vote
0 answers

Get the next record in EF where records are not ordered by ID

I need to write a query that will return a single record, and this record would be the next record from the record with provided ID. var x = GetNextRecord(int recordId); The problem is that data is not ordered by ID, but by some other criteria.…
1
vote
1 answer

Is writing eSQL database independent or not?

Using EF we can use LINQ to read data which is rather simple (especially using fluent calls), but we have less control unless we write eSQL on our own. Is writing eSQL actually data store independent code? So if we decide to change data store, can…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
1
vote
4 answers

Entity framework (3.5): How to translate a certain LINQ query to eSQL?

I have the following LINQ query that I need to translate to Entity SQL /eSQL): return (ObjectQuery) from user in Users where !user.Roles.Any(r => r.AnIntegerProperty < 0) select user; User.Roles is an navigation property to the n:m…
Sebastian P.R. Gingter
  • 5,955
  • 3
  • 31
  • 73
1
vote
0 answers

SelectMany equivalent in EntitySQL

I'm battling with an E-SQL query where one of my fields in the a list. My problem is how do I get this to be flattened. My query is as below: select value d from (select ( select value tagEntry from x.application.applicantIssues as tagEntry…
ritcoder
  • 3,274
  • 10
  • 42
  • 62
1
vote
2 answers

Spatial support in Entity SQL

I'm generating Entity SQL to provide dynamic query support in my application. I have however been unable to find how one is able to specify spatial conditions in Entity SQL using Entity Framework 5. A query using Linq to Entities against a model…
1
vote
1 answer

How to build dynamic WHERE clauses using dbContext

We need to create dynamic WHERE Clauses depending on user input. Using the old ObjectContext we found a way by using .Where(). Dim qry As ObjectQuery(Of MESSGROESSE) = _objContext.MESSGROESSE If Not…
Peter Meinl
  • 2,566
  • 25
  • 39
1
vote
1 answer

Comparing Date / DateTime ine Entity SQL Where clause

I have a method which accepts an ObjectQuery and adds Where clauses to it depending on whether it receives values for various filter parameters. The method has to return an ObjectQuery. How can i do a basic Date comparison e.g. where dateX <…
andrej351
  • 904
  • 3
  • 18
  • 38
1
vote
1 answer

How can I get the entity types' name in an esql query

We've ran into a scenario where we need to be able to return the name of an entity type as a value in the result of an esql statement. The problem is this, we have a generic helper in place that builds and runs an esql statement to return a result…
1
vote
1 answer

Making a generic Query, how?

Here is my working Code: var queryString = "SELECT VALUE c " + "FROM EMI_ERPContext.Customer AS c " + "WHERE c.FirstName='Emanuel'"; ObjectQuery customers =…
eMi
  • 5,540
  • 10
  • 60
  • 109
0
votes
2 answers

Searching free accomodation

I need help with a query? I have 2 tables reservations & units among others. Table reservations has columns ResId,rfrom(datetime),rto(datetime),status(int),UnitID(foreign key). Status 2 means its confirmed. I need to get all free units in requested…
marinnn
0
votes
1 answer

Entity query select '*' error

i am using esql to select by using entity framework Here is my coding using (ObjectContext ctx = new ObjectContext("Name=LEWREDBEntities")) { string result = "select articleDetail.*,…
user998405
  • 1,329
  • 5
  • 41
  • 84
0
votes
1 answer

Working with the ObjectQuery Single Enumeration Challenge in Linq-To-Entities Entity SQL

I'm working on modifying this example: Using advWorksContext As New AdventureWorksEntities ' Call the constructor that takes a command string and ObjectContext. Dim productQuery1 As New ObjectQuery(Of Product)("Product", advWorksContext) …
Jeff
  • 8,020
  • 34
  • 99
  • 157
0
votes
1 answer

How to get the Entity-SQL command text by LINQ query?

It's an exercise of EF code-first. There's a simple method. I want to get the Entity SQL command text generated by object services. (MyDbContext is derived form DbContext. Person is a POCO class.) using (MyDbContext context = new MyDbContext()) { …
Abbey
  • 34
  • 1
  • 9
0
votes
1 answer

EntitySQL 'IN subquery

I have the following T-SQL: SELECT Cust.[CompanyName] FROM Customers AS Cust WHERE ( Cust.[CompanyName] IN (SELECT CustSQ1.[CompanyName] AS [Customer Company name] FROM Customers AS CustSQ1 WHERE ( CustSQ1.Country = 'Argentina' ) ) ) How do I…
Oleg Golovkov
  • 596
  • 1
  • 4
  • 18