3

How I can send a linq query as string to Entity Framework for example:

from s in students select s

I want to compile this in oracle and sql server

1
  • 1
    Entity Sql is designed for this sort of thing, linq to entities would mean you have to execute dynamic code, which is nasty to say the least. Commented Nov 22, 2010 at 11:13

2 Answers 2

6

You might want to have a look at Entity SQL.
Here is an example: http://msdn.microsoft.com/en-us/library/bb738684.aspx

Another possibility is Dynamic LINQ.

Sign up to request clarification or add additional context in comments.

2 Comments

Entity Sql gets string command but it is not linq query and it has kind of sql server structure howover I want to compile this in orcal and sql.
Entity SQL is just as database-independent as normal LINQ, i.e. it gets translated to your Database's native query language, too. However, you can also have a look at Dynamic LINQ (see edit of my answer).
0

i use Dynamic Linq to dynamically construct linq queries at run time

http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

1 Comment

it seems that it is limited to condition of query but I want to construct the whole of query

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.