• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

LINQ vs SQL

ice91785

Senior member
So I have been kind of wanting to learn more about LINQ and SQL for a while...I have a general knowledge but! not enough...

LINQ and SQL are used to query data sources obviously...how do these guys compare&contrast. For LINQ, What does language-integrated mean (or why is it even important)? What are the main types of data sources that each supports (databases are the only that I know of)? I know generally what a query is, but what are some other examples of query operations (obviously querying a database for a phone number or something may be important to some but not others).

I don't know, just some random thoughts for the day

EDIT: fixed ur to YOUR in summary 😉
 
First thought: "ur" is annoying, you're not texting, type the extra two letters.
Second thought: I've only used SQL (T-SQL and MySQL, and whatever they call the bastard offspring of SQL that's in MS Access)
Main operations are SELECT, UPDATE, and DELETE
Third thought: Wrong forum
 
WTF? You mean we don't have a specialized "Database Query Language" forum here?

How ghetto of us. 😛

(/me barely knows wtf a "database query language" even is) 😀
 
Originally posted by: nakedfrog
First thought: "ur" is annoying, you're not texting, type the extra two letters.
Second thought: I've only used SQL (T-SQL and MySQL, and whatever they call the bastard offspring of SQL that's in MS Access)
Main operations are SELECT, UPDATE, and DELETE
Third thought: Wrong forum

Look out!!! The frog is cranky!!!
 
School is over for this guy (me) -- no homework here; genuine THIRST for knowledge also it was a repost and for this I am sorry
 
SQL = nearly universal language for querying a relational DB. Anyone who considers themselves a programmer should know this
LINQ = cool new query technology built into new versions of .net. Unless you are working in .Net this will have limited use for you to know, but it is nonetheless a cool feature that implements a lot of the advanced stuff one might learn in compiler classes and similar. Can query against basically any type of data that has a linq provider for it. Enumerables, xml, sql server, etc.
 
Originally posted by: ice91785
School is over for this guy (me) -- no homework here; genuine THIRST for knowledge also it was a repost and for this I am sorry

I'm still learning t-sql but it seems that linq is geared more towards adding another layer of abstraction on top of what sql can give you.
 
The only LINQ i have really dabbled with is a touch with some C# (in VS 2008) programs that i've been doing -- I then found out that its apparently a pretty big thing! A lot of SQL is better, no I think LINQ is better...etc. Obviously used a little differently though which is what spurned me to post
 
LINQ and SQL aren't really directly comparable. LINQ was developed by MS for use in .NET languages and as far as I know (could be wrong) it only exists in the .NET framework. SQL is a whole language unto itself, designed specifically for querying databases. It works well for this purpose.

Now, the cool thing about LINQ (which I'm totally in love with) is that you can query any object or collection that implements the IQueryable<T> interface. This includes all of the .NET BCL collections, XML data types, JSON data, all database types, ADO.NET objects and much more. You can also write your own collections that implement IQueryable<T>.

LINQ has a similar syntax to SQL, except that the FROM clause goes first and the SELECT clause at the end. This is so that intellisense will work in VS. LINQ allows you to create anonymous types too, which is farking awesome.
 
Originally posted by: Goosemaster
Originally posted by: ice91785
School is over for this guy (me) -- no homework here; genuine THIRST for knowledge also it was a repost and for this I am sorry

I'm still learning t-sql but it seems that linq is geared more towards adding another layer of abstraction on top of what sql can give you.

Not really, it's at a pretty similar level of abstraction as SQL, it's just far more powerful and, importantly, language integrated.
 
Originally posted by: GodlessAstronomer
Originally posted by: Goosemaster
Originally posted by: ice91785
School is over for this guy (me) -- no homework here; genuine THIRST for knowledge also it was a repost and for this I am sorry

I'm still learning t-sql but it seems that linq is geared more towards adding another layer of abstraction on top of what sql can give you.

Not really, it's at a pretty similar level of abstraction as SQL, it's just far more powerful and, importantly, language integrated.

Good to know. (not there yet myself but will be eventually)
One of my projects will involve ADO.net iirc
 
Originally posted by: Goosemaster
Originally posted by: GodlessAstronomer
Originally posted by: Goosemaster
Originally posted by: ice91785
School is over for this guy (me) -- no homework here; genuine THIRST for knowledge also it was a repost and for this I am sorry

I'm still learning t-sql but it seems that linq is geared more towards adding another layer of abstraction on top of what sql can give you.

Not really, it's at a pretty similar level of abstraction as SQL, it's just far more powerful and, importantly, language integrated.

Good to know. (not there yet myself but will be eventually)
One of my projects will involve ADO.net iirc

I haven't done it myself, but I'm fairly sure ADO.net integrates well with LINQ.

Originally posted by: ice91785
Godless -- good post, but a lot was over my head 😛

I have to go to uni now, but I'll come back this afternoon and explain it more carefully if you like.
 
Back
Top