This question is locked. New answers and comments are not allowed.
Hi,
How do I write LINQ to SQL queries in OpenAccess? Is it supported?
query = From row in scope.Extent(of Products)
Is this linq to entities or linq to sql? I dont want to download all the products from the database.
I want to write linq to sql queries, how do I do that?
How do I write LINQ to SQL queries in OpenAccess? Is it supported?
query = From row in scope.Extent(of Products)
Is this linq to entities or linq to sql? I dont want to download all the products from the database.
I want to write linq to sql queries, how do I do that?
7 Answers, 1 is accepted
0
Hello Sathish,
LINQ to SQL is speciffic LINQ dialect implemented by ty the L2S runtime. What we provide is LINQ to OpenAccess - you can run LINQ queries against the OpenAccess runtime. The only speciffic thing is that you use the scope instead of L2S datacontext, and the Extent extension method to get the entity sets, example:
L2S: context.GetCustomers() returns all customer entities
OpenAccess: context.Extent<Customer>() returns all customer entities.
The differences are very small as in both cases it is LINQ notation.
Sincerely yours,
Dimitar Kapitanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
LINQ to SQL is speciffic LINQ dialect implemented by ty the L2S runtime. What we provide is LINQ to OpenAccess - you can run LINQ queries against the OpenAccess runtime. The only speciffic thing is that you use the scope instead of L2S datacontext, and the Extent extension method to get the entity sets, example:
L2S: context.GetCustomers() returns all customer entities
OpenAccess: context.Extent<Customer>() returns all customer entities.
The differences are very small as in both cases it is LINQ notation.
Sincerely yours,
Dimitar Kapitanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sathish
Top achievements
Rank 1
answered on 03 Mar 2009, 01:58 PM
Hi,
Thank you for the response. I understand that aspect of it, my question is more data related. So, If I have a linq statement such as
query = from row in scope.extent<customers> _
where row.id > 100
does this download the whole table data and then run the where condition against it? or does it generate "SELECT * FROM customers where row.id > 100"
I dont want all the data to be download. I want it to convert my conditions to sql and exract only those data. does ORM support that?
Thank you for the response. I understand that aspect of it, my question is more data related. So, If I have a linq statement such as
query = from row in scope.extent<customers> _
where row.id > 100
does this download the whole table data and then run the where condition against it? or does it generate "SELECT * FROM customers where row.id > 100"
I dont want all the data to be download. I want it to convert my conditions to sql and exract only those data. does ORM support that?
0
Hi Sathish,
We try to push as much as possible of your query to the server. In your case SELECT * FROM customers where row.id > 100 will be generated. If that is not possible we inform you during compilation or runtime about the non-optimal query execution.
Regards,
Jan Blessenohl
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We try to push as much as possible of your query to the server. In your case SELECT * FROM customers where row.id > 100 will be generated. If that is not possible we inform you during compilation or runtime about the non-optimal query execution.
Regards,
Jan Blessenohl
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sathish
Top achievements
Rank 1
answered on 03 Mar 2009, 03:35 PM
Thank you very much for the reply. I just wanted to confirm that, because I will be quering a table with more than 100,000 records and I certainly do not want to download the whole table.
I have another question,
Where can I find a step by step tutorial about fetch plans, from the basics to advanced.
Also, there are few bugs that I have come across in OA. Can I report them in forum here?
I have another question,
Where can I find a step by step tutorial about fetch plans, from the basics to advanced.
Also, there are few bugs that I have come across in OA. Can I report them in forum here?
0
Hi Sathish,
Thank you for your continuous feedback.
Please review the following resources for more information about Fetch Plans
Please see also the documentation for Fetch Groups and related
Last not least, you can also check an example project from our code library using Fetch Plans.
Concerning bug reports, please download the most current trial version of OpenAccess and create a bug report ticket.
Thanks for your contributions.
All the best,
Peter Brunner
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you for your continuous feedback.
Please review the following resources for more information about Fetch Plans
- Fetch Plans Introduction
- KB: Using Fetch Plans
- Fetch Plans First Step Example
- Fetch Plan Browser Documentation
Please see also the documentation for Fetch Groups and related
Last not least, you can also check an example project from our code library using Fetch Plans.
Concerning bug reports, please download the most current trial version of OpenAccess and create a bug report ticket.
Thanks for your contributions.
All the best,
Peter Brunner
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sathish
Top achievements
Rank 1
answered on 11 Mar 2009, 09:58 PM
Hi,
When I am writing a LINQ To OpenAccess query, what is the type of the object I am writing to? Is it Iqueryable.
If I write
Dim myQuery as IQuery (<-- IS THIS CORRECT? Should I use IQuery or Iqueryable?)
myQuery = From row in os.Extent(Of Customer) WHERE ID > 100
Does it translate into SQL query of "SELECT * FROM Customers WHERE ID > 100"
or does it download the whole of customers table into memory and do a LINQ to Entities (i.e. loop through the data and return the result)
I do not see as much performance as I should. Could you please confirm.
Thank you.
When I am writing a LINQ To OpenAccess query, what is the type of the object I am writing to? Is it Iqueryable.
If I write
Dim myQuery as IQuery (<-- IS THIS CORRECT? Should I use IQuery or Iqueryable?)
myQuery = From row in os.Extent(Of Customer) WHERE ID > 100
Does it translate into SQL query of "SELECT * FROM Customers WHERE ID > 100"
or does it download the whole of customers table into memory and do a LINQ to Entities (i.e. loop through the data and return the result)
I do not see as much performance as I should. Could you please confirm.
Thank you.
0
Hello Sathish,
The type of result an OpenAccess Linq query is returning is IObjectScopeQuery<T>, which implements IQueriable<T> so you can use both of them.
When a query like the one you asked for in your previous ticket executes, an SQL similar to "SELECT * FROM Customers WHERE ID > 100" is generated and only the desired result are returned. Not all objects are loaded in memory.
If you require any other information regarding OpenAccess please do not hesitate to contact us again.
Kind regards,
Zoran
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The type of result an OpenAccess Linq query is returning is IObjectScopeQuery<T>, which implements IQueriable<T> so you can use both of them.
When a query like the one you asked for in your previous ticket executes, an SQL similar to "SELECT * FROM Customers WHERE ID > 100" is generated and only the desired result are returned. Not all objects are loaded in memory.
If you require any other information regarding OpenAccess please do not hesitate to contact us again.
Kind regards,
Zoran
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.