DLinq

G

Guest

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.
 
R

Richard Blewett [DevelopMentor]

The filtering is performed on the server in this case

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.
 
G

Guest

Won't that be a performance hit for large amount of data. What if the
Customers table contains one million rows, these have to be sent over the
network and after the filtering is done it may onlybe 50 rows left that are
any use.
 
R

Richard Blewett [DevelopMentor]

No, quite the opposite. The data already exists in the database and its using standard database functionality to extract only the data that matches the filter. The alternative would be to bring the one million rows back to the client and filter them there which would be a nightmare scenario in terms of network traffic and client processing required

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Won't that be a performance hit for large amount of data. What if the
Customers table contains one million rows, these have to be sent over the
network and after the filtering is done it may onlybe 50 rows left that are
any use.

Richard Blewett said:
The filtering is performed on the server in this case

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.

[microsoft.public.dotnet.languages.csharp]
 
G

Guest

Ok, so
from c in db.Customers where c.City == "London" select c
does create a sql on the fly. Good to know.

Thanks for your answers.



Richard Blewett said:
No, quite the opposite. The data already exists in the database and its using standard database functionality to extract only the data that matches the filter. The alternative would be to bring the one million rows back to the client and filter them there which would be a nightmare scenario in terms of network traffic and client processing required

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Won't that be a performance hit for large amount of data. What if the
Customers table contains one million rows, these have to be sent over the
network and after the filtering is done it may onlybe 50 rows left that are
any use.

Richard Blewett said:
The filtering is performed on the server in this case

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.

[microsoft.public.dotnet.languages.csharp]
 
J

jeremiah johnson

It creates SQL, but not like you're thinking. note that the FROM clause
is before the SELECT clause. Think of it as a collection of objects,
that you query, not a database. That's the point of dlinq.

watch this video: http://channel9.msdn.com/Showpost.aspx?postid=114680

dlinq is much more powerful than SQL+DataBase.

jeremiah
Ok, so
from c in db.Customers where c.City == "London" select c
does create a sql on the fly. Good to know.

Thanks for your answers.



:

No, quite the opposite. The data already exists in the database and its using standard database functionality to extract only the data that matches the filter. The alternative would be to bring the one million rows back to the client and filter them there which would be a nightmare scenario in terms of network traffic and client processing required

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Won't that be a performance hit for large amount of data. What if the
Customers table contains one million rows, these have to be sent over the
network and after the filtering is done it may onlybe 50 rows left that are
any use.

Richard Blewett said:
The filtering is performed on the server in this case

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.

[microsoft.public.dotnet.languages.csharp]
 
G

Guest

Hi

I found a document which explains everything one need to know about DLinq.
It certainly made me drool. To bad one have to wait until 2008 or so. :)

DLinq, .NET Language Integrated Query for Relational Data at
http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/DLinq Overview.doc

Cheers / Senna

jeremiah johnson said:
It creates SQL, but not like you're thinking. note that the FROM clause
is before the SELECT clause. Think of it as a collection of objects,
that you query, not a database. That's the point of dlinq.

watch this video: http://channel9.msdn.com/Showpost.aspx?postid=114680

dlinq is much more powerful than SQL+DataBase.

jeremiah
Ok, so
from c in db.Customers where c.City == "London" select c
does create a sql on the fly. Good to know.

Thanks for your answers.



:

No, quite the opposite. The data already exists in the database and its using standard database functionality to extract only the data that matches the filter. The alternative would be to bring the one million rows back to the client and filter them there which would be a nightmare scenario in terms of network traffic and client processing required

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Won't that be a performance hit for large amount of data. What if the
Customers table contains one million rows, these have to be sent over the
network and after the filtering is done it may onlybe 50 rows left that are
any use.

:

The filtering is performed on the server in this case

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi

Have a question about DLinq.

The example code floating around looks like this:

Northwind db = new Northwind(@"C:\...\northwnd.mdf");
var custs = from c in db.Customers where c.City == "London" select c;

How does this work. Will it retreive all the rows from the Customer table
and then filter and select. Or does it generate a sql on the fly which will
return only the proper rows.

Or am I getting it all wrong.



[microsoft.public.dotnet.languages.csharp]
 
F

Frans Bouma [C# MVP]

jeremiah said:
It creates SQL, but not like you're thinking. note that the FROM
clause is before the SELECT clause. Think of it as a collection of
objects, that you query, not a database. That's the point of dlinq.

watch this video: http://channel9.msdn.com/Showpost.aspx?postid=114680

dlinq is much more powerful than SQL+DataBase.

No, that's Linq, not DLinq. Linq is very powerful. DLinq is an
implementation on top of Linq for O/R mapping purposes, and not very
well done at this point. What you refer to is the Linq system.

FB

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top