Don't think why this guy is jumping from framework basics to LINQ. Please understand that this blog is not intended to teach you .net framework concepts one after the other like a text book.
You and me know, there are many wonderful sites already exists in this universe serving the same purpose. My goal is just to present few .net concepts in my own way.Those concepts may not be in a standard tutorial sequence. This time, i decided to jump on to LINQ. Please accept (You have no other choice).
Shall we start ?
Sure ?
From the beginning of my software career, I'm a big fan of SQL. It is a nice questioning language where we can ask questions and give orders to the database in almost plain English like below.
SELECT * FROM GIRLSHOSTEL
SELECT * FROM GIRLSHOSTEL WHERE AGE BETWEEN 18 AND 25
SELECT * FROM GIRLSHOSTEL WHERE COMPLEXION = 'White'
I can simply ask like this and any database should accept my question and return results.
Life is happy and wonderful till i have to ask questions to 'something' which is not a database but contains data. Especially i hate to deal with data in arrays (lists) and also gets vomiting while dealing with data in XML format. I don't know why but the word XPath sounds like a ghost smile to me. Querying from this kind of data is like roller coaster drive.Technically looks simple but emotionally irritating. (Relax..Ajay..don't take it too personal.)
I want to stop my agony here but i can't. You know why, sometimes we will be having collection of objects. For example in the above SQL example, I'm taking data from a database table called "GIRLSHOSTEL". Suppose database is not there. All 100 girls information stored as a collection of girl objects.
Now i want to know how many grils are there whose name starts with "Brooke" (When i was in my primary school, "The Blue Lagoon" movie came. Still i cannot forget Brooke Shields. She pushed me into a confusion whether I'm kid or a teenager).
(Ajay..you are going personal again...come back...)
Where are we ?
Broo...NO..getting data from objects.
How can you do that ?
I don't know how you will do but i will give my keyboard to my team mate and go to canteen.
Please don't stop me here. One more thing i must tell you.
You know text files ?
If you are billing your customer heavily , he will not give GirlsHostel data in a database. He will give it in a comma delimited text file.
He will ask you to get average of all the girls age by reading the text file.
How will you do ?
Don't ask me. I hate looping through text files, splitting, checking..yalk...
I think Microsoft heard my prolonged cry.
They came back to me with a boon of my lifetime.
They came back with a bang.
Boys and Girls..here is LINQ (Language Integrated Query) for you.
Have any kind of data which looks like a list. Just ask it what ever questions you have. It simply returns the data for you.
For the next few posts i would like to be your loving host on our LINQ journey. In this journey we will be touching Objects, Databases, XML and Datasets via LINQ. We will understand how to question and manipulate all these data sources using our brilliant and intelligent friend LINQ.
Shall i sign-off now ?
Catch you soon.
You and me know, there are many wonderful sites already exists in this universe serving the same purpose. My goal is just to present few .net concepts in my own way.Those concepts may not be in a standard tutorial sequence. This time, i decided to jump on to LINQ. Please accept (You have no other choice).
Shall we start ?
Sure ?
From the beginning of my software career, I'm a big fan of SQL. It is a nice questioning language where we can ask questions and give orders to the database in almost plain English like below.
SELECT * FROM GIRLSHOSTEL
SELECT * FROM GIRLSHOSTEL WHERE AGE BETWEEN 18 AND 25
SELECT * FROM GIRLSHOSTEL WHERE COMPLEXION = 'White'
I can simply ask like this and any database should accept my question and return results.
Life is happy and wonderful till i have to ask questions to 'something' which is not a database but contains data. Especially i hate to deal with data in arrays (lists) and also gets vomiting while dealing with data in XML format. I don't know why but the word XPath sounds like a ghost smile to me. Querying from this kind of data is like roller coaster drive.Technically looks simple but emotionally irritating. (Relax..Ajay..don't take it too personal.)
I want to stop my agony here but i can't. You know why, sometimes we will be having collection of objects. For example in the above SQL example, I'm taking data from a database table called "GIRLSHOSTEL". Suppose database is not there. All 100 girls information stored as a collection of girl objects.
Now i want to know how many grils are there whose name starts with "Brooke" (When i was in my primary school, "The Blue Lagoon" movie came. Still i cannot forget Brooke Shields. She pushed me into a confusion whether I'm kid or a teenager).
(Ajay..you are going personal again...come back...)
Where are we ?
Broo...NO..getting data from objects.
How can you do that ?
I don't know how you will do but i will give my keyboard to my team mate and go to canteen.
Please don't stop me here. One more thing i must tell you.
You know text files ?
If you are billing your customer heavily , he will not give GirlsHostel data in a database. He will give it in a comma delimited text file.
He will ask you to get average of all the girls age by reading the text file.
How will you do ?
Don't ask me. I hate looping through text files, splitting, checking..yalk...
I think Microsoft heard my prolonged cry.
They came back to me with a boon of my lifetime.
They came back with a bang.
Boys and Girls..here is LINQ (Language Integrated Query) for you.
Have any kind of data which looks like a list. Just ask it what ever questions you have. It simply returns the data for you.
For the next few posts i would like to be your loving host on our LINQ journey. In this journey we will be touching Objects, Databases, XML and Datasets via LINQ. We will understand how to question and manipulate all these data sources using our brilliant and intelligent friend LINQ.
Shall i sign-off now ?
Catch you soon.
No comments:
Post a Comment