It allows you to query collections like arrays, enumerable classes etc in the native language of your application, like VB or C# in much the same way as you would query a database using SQL. LINQ to SQL, which is what most of the current fuss is about, is
an Object/Relational Mapper (O/RM) built in to Visual Studio. It automatically generates entity classes based on the database schema, so it helps speed up development of n-layer arhitecture applications.
As Mike said, LINQ to SQL is not nessecarily going to speed up data access code. Since LINQ to SQL is abstraction over the low level ADO.NET command and connection classes, it's bound to be a bit slower at runtime (but hopefully faster to develop with).
one reason is might be that extracting data from sql users have to perform lot of operation to organize the data but in LINQ all the operations are supported bec you are writing the database extraction query in the same language.
It seems to m that the main advantage of Linq over writing a stored procedure in management studio is the hard typing of tables and parameters and auto completion of column names. The amount of code to connect to the database is significantly reduced - to
one or two lines making code much more readable and removing coding errors. A major disadvantage seem to be that in the current release the declarative order of the columns is not maintained int the query output:
In simple terms if (In SQL Structured Query Language) I declare
SELECT Zulu, Uniform, Xray FROM MyTable
The results are in column order Zulu, Uniform, Xray
In simple terms if (In LINQ Language Integrated Query I declare
FROM MyTable SELECT Zulu, Uniform, Xray
The results are in column order X, Y , Z
This is (to me) nonsensical. Actually the way around seems to be to not auto generate columns, and cut the aspx - which largely eliminated the advantages of using linq in the first place....
jeyaseelan@a...
Contributor
5124 Points
2025 Posts
Advantages of LINQ?
Mar 22, 2008 12:55 PM|LINK
advantages linq
J.Jeyaseelan
Mikesdotnett...
All-Star
155645 Points
19985 Posts
Moderator
MVP
Re: Advantages of LINQ?
Mar 22, 2008 02:02 PM|LINK
LINQ does not replace Sql Management Studio. They have nothing to do with eachother.
Web Pages CMS | My Site | Twitter
jeyaseelan@a...
Contributor
5124 Points
2025 Posts
Re: Advantages of LINQ?
Mar 24, 2008 04:22 AM|LINK
Thanks for your answer,
then may i know what are the advantages of LINQ?
J.Jeyaseelan
Mikesdotnett...
All-Star
155645 Points
19985 Posts
Moderator
MVP
Re: Advantages of LINQ?
Mar 24, 2008 05:59 AM|LINK
It allows you to query collections like arrays, enumerable classes etc in the native language of your application, like VB or C# in much the same way as you would query a database using SQL. LINQ to SQL, which is what most of the current fuss is about, is an Object/Relational Mapper (O/RM) built in to Visual Studio. It automatically generates entity classes based on the database schema, so it helps speed up development of n-layer arhitecture applications.
Web Pages CMS | My Site | Twitter
jeyaseelan@a...
Contributor
5124 Points
2025 Posts
Re: Advantages of LINQ?
Mar 25, 2008 10:24 AM|LINK
Thanks for your answer ,
Finaly have one more question
Is LINQ speed up the database operation compared than sqlclient(Sqlconnection,SqlCommand etc.,) ?
If yes then tell me the difference in Seconds / Minutes ?
LINQ is came under Ado.Net or separately ?
linq speed up
J.Jeyaseelan
Mikesdotnett...
All-Star
155645 Points
19985 Posts
Moderator
MVP
Re: Advantages of LINQ?
Mar 25, 2008 02:39 PM|LINK
No it doesn't necessarily speed up operations. It is part of ADO.NET according to this article: http://msdn2.microsoft.com/en-us/library/bb386944.aspx
Web Pages CMS | My Site | Twitter
bitmask
Contributor
6739 Points
1245 Posts
MVP
Re: Advantages of LINQ?
Mar 25, 2008 04:00 PM|LINK
As Mike said, LINQ to SQL is not nessecarily going to speed up data access code. Since LINQ to SQL is abstraction over the low level ADO.NET command and connection classes, it's bound to be a bit slower at runtime (but hopefully faster to develop with).
There is more to LINQ than just database work, too. I have an intro article on LINQ here: http://www.odetocode.com/articles/737.aspx
Hope that helps,
http://www.OdeToCode.com/blogs/scott/
http://twitter.com/OdeToCode
Mikesdotnett...
All-Star
155645 Points
19985 Posts
Moderator
MVP
Re: Advantages of LINQ?
Mar 25, 2008 04:13 PM|LINK
Before jeyaseelan asks, it's probably worth pointing out that the difference would be in milliseconds, not seconds or minutes....
Web Pages CMS | My Site | Twitter
kmughal
Member
14 Points
2 Posts
Re: Advantages of LINQ?
Apr 18, 2008 10:56 AM|LINK
one reason is might be that extracting data from sql users have to perform lot of operation to organize the data but in LINQ all the operations are supported bec you are writing the database extraction query in the same language.
ex glider pi...
Member
5 Points
7 Posts
Re: Advantages of LINQ?
May 12, 2008 04:02 PM|LINK
It seems to m that the main advantage of Linq over writing a stored procedure in management studio is the hard typing of tables and parameters and auto completion of column names. The amount of code to connect to the database is significantly reduced - to one or two lines making code much more readable and removing coding errors. A major disadvantage seem to be that in the current release the declarative order of the columns is not maintained int the query output:
In simple terms if (In SQL Structured Query Language) I declare
SELECT Zulu, Uniform, Xray FROM MyTable
The results are in column order Zulu, Uniform, Xray
In simple terms if (In LINQ Language Integrated Query I declare
FROM MyTable SELECT Zulu, Uniform, Xray
The results are in column order X, Y , Z
This is (to me) nonsensical. Actually the way around seems to be to not auto generate columns, and cut the aspx - which largely eliminated the advantages of using linq in the first place....
LINQ SQL column order
Ava producers of leading Temp Agency Software