SlideShare a Scribd company logo
Hi friends
C# Tutorial
Part 39:
LINQ
www.siri-kt.blogspot.com
• LINQ(language integrated query):
• LINQ queries are used to filter the data and format the
data. LINQ queries Microsoft designed using "generic"
classes and with anonymous data types.
• anonymous datatype means it allows integer types, string
types and object types
• ex:
• int[] i={1,5,8,9,12,15,50,20,30};
• var x=from n in i where n>5 select n;
• select * from emp
• as per .NET technologies "var" is anonymous datatype.
• LINQ queries we can inherit to the object, ado.net and
to the xml.
• example on LINQ:(retrieving greater than 5 array values)
• 1.take the form
• 2.add listbox and one button control
• source code:
• private void button1_Click(object sender, EventArgs e)
• { int[] i = { 1, 22, 3, 8, 9, 15, 14, 16, 18 };
• var x = from n in i where n > 5 select n;
• foreach (var v in x)
• {
• listBox1.Items.Add(v.ToString());
• } }
• ex:
• retrieving Even numbers from the array list
• 1.take the form
• 2.add listbox and one button control
• source code:
• private void button1_Click(object sender, EventArgs e)
• { int[] i = { 1, 5, 6, 4, 7, 9, 11, 13, 15, 16 };
• var x = from n in i where n % 2 == 0 select n;
• foreach (var v in x)
• { listBox1.Items.Add(v.ToString());
• } }
• ex:
• string array elements arrange in ascending order:
• 1.take the form
• 2.add listbox and one button control
• source code:
• private void button1_Click(object sender, EventArgs e)
• { string[] nos = { "one", "two", "three", "four",
"five", "six", "seven", "eight", "nine", "ten" };
• var no = from n in nos orderby n ascending select n;
• foreach (var v in no)
• { listBox1.Items.Add(v.ToString());
• } }
For more visit our website www.siri-kt.blogspot.com
Thanks for
Watching
More Angular JS TutorialsMore C sharp (c#) tutorials

More Related Content

What's hot (12)

PPTX
Introduction to Java Programming
Pokequesthero
 
PDF
C++ Templates_ Program to Swap Two Numbers Using Function Template - The Craz...
Rishikesh Agrawani
 
PDF
Java Unit 1 Project
Matthew Abela Medici
 
PPTX
Java Tutorial Lab 8
Berk Soysal
 
PDF
Import data from csv excel file and export to xml excel file in c programming
Salar Delavar Qashqai
 
PPTX
Oct13' ----
Tak Lee
 
PPTX
Theano tutorial
Serhii Havrylov
 
PPT
Javascript - Getting Good with Object
Firdaus Adib
 
PPTX
Seminar 2 coding_principles
moduledesign
 
TXT
123
htmrk
 
PDF
Contact Book Version 1.0
Salman Mushtaq
 
PPTX
Basics of PHP
hamsa nandhini
 
Introduction to Java Programming
Pokequesthero
 
C++ Templates_ Program to Swap Two Numbers Using Function Template - The Craz...
Rishikesh Agrawani
 
Java Unit 1 Project
Matthew Abela Medici
 
Java Tutorial Lab 8
Berk Soysal
 
Import data from csv excel file and export to xml excel file in c programming
Salar Delavar Qashqai
 
Oct13' ----
Tak Lee
 
Theano tutorial
Serhii Havrylov
 
Javascript - Getting Good with Object
Firdaus Adib
 
Seminar 2 coding_principles
moduledesign
 
123
htmrk
 
Contact Book Version 1.0
Salman Mushtaq
 
Basics of PHP
hamsa nandhini
 

Similar to 39c (11)

PPTX
IOT notes,................................
taetaebts431
 
PPTX
Java basic Programming.pptx
nuevodennis
 
PDF
Αλγόριθμοι
Ρεβέκα Θεοδωροπούλου
 
PDF
Programming in python Unit-1 Part-1
Vikram Nandini
 
PDF
CP PPT_Unit IV computer programming in c.pdf
saneshgamerz
 
PPTX
Basic use of Python
Yoshiki Satotani
 
PPTX
Java class 5
Edureka!
 
PPTX
An Overview of the Java Programming Language
Salaam Kehinde
 
PPTX
R1-Intro (2udsjhfkjdshfkjsdkfhsdkfsfsffs
sabari Giri
 
PDF
EDA tools and making sense of data.pdf
9wldv5h8n
 
PPTX
Presentation1 computer shaan
walia Shaan
 
IOT notes,................................
taetaebts431
 
Java basic Programming.pptx
nuevodennis
 
Programming in python Unit-1 Part-1
Vikram Nandini
 
CP PPT_Unit IV computer programming in c.pdf
saneshgamerz
 
Basic use of Python
Yoshiki Satotani
 
Java class 5
Edureka!
 
An Overview of the Java Programming Language
Salaam Kehinde
 
R1-Intro (2udsjhfkjdshfkjsdkfhsdkfsfsffs
sabari Giri
 
EDA tools and making sense of data.pdf
9wldv5h8n
 
Presentation1 computer shaan
walia Shaan
 
Ad

More from Sireesh K (20)

PPTX
Cn10
Sireesh K
 
PPTX
chanakya neeti
Sireesh K
 
PPTX
chanakya neeti
Sireesh K
 
DOCX
What is mvc
Sireesh K
 
PPTX
31c
Sireesh K
 
PPTX
31cs
Sireesh K
 
PPTX
45c
Sireesh K
 
PPTX
44c
Sireesh K
 
PPTX
43c
Sireesh K
 
PPTX
42c
Sireesh K
 
PPTX
41c
Sireesh K
 
PPTX
40c
Sireesh K
 
PPTX
38c
Sireesh K
 
PPTX
37c
Sireesh K
 
PPTX
35c
Sireesh K
 
PPTX
34c
Sireesh K
 
PPTX
33c
Sireesh K
 
PPTX
30c
Sireesh K
 
PPTX
29c
Sireesh K
 
PPTX
27c
Sireesh K
 
Cn10
Sireesh K
 
chanakya neeti
Sireesh K
 
chanakya neeti
Sireesh K
 
What is mvc
Sireesh K
 
31cs
Sireesh K
 
Ad

Recently uploaded (20)

PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
LDP-2 UNIT 4 Presentation for practical.pptx
abhaypanchal2525
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Introduction to Probability(basic) .pptx
purohitanuj034
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PDF
Tips for Writing the Research Title with Examples
Thelma Villaflores
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
LDP-2 UNIT 4 Presentation for practical.pptx
abhaypanchal2525
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Introduction to Probability(basic) .pptx
purohitanuj034
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Tips for Writing the Research Title with Examples
Thelma Villaflores
 

39c

  • 1. Hi friends C# Tutorial Part 39: LINQ www.siri-kt.blogspot.com
  • 2. • LINQ(language integrated query): • LINQ queries are used to filter the data and format the data. LINQ queries Microsoft designed using "generic" classes and with anonymous data types. • anonymous datatype means it allows integer types, string types and object types • ex: • int[] i={1,5,8,9,12,15,50,20,30}; • var x=from n in i where n>5 select n; • select * from emp • as per .NET technologies "var" is anonymous datatype. • LINQ queries we can inherit to the object, ado.net and to the xml.
  • 3. • example on LINQ:(retrieving greater than 5 array values) • 1.take the form • 2.add listbox and one button control • source code: • private void button1_Click(object sender, EventArgs e) • { int[] i = { 1, 22, 3, 8, 9, 15, 14, 16, 18 }; • var x = from n in i where n > 5 select n; • foreach (var v in x) • { • listBox1.Items.Add(v.ToString()); • } }
  • 4. • ex: • retrieving Even numbers from the array list • 1.take the form • 2.add listbox and one button control • source code: • private void button1_Click(object sender, EventArgs e) • { int[] i = { 1, 5, 6, 4, 7, 9, 11, 13, 15, 16 }; • var x = from n in i where n % 2 == 0 select n; • foreach (var v in x) • { listBox1.Items.Add(v.ToString()); • } }
  • 5. • ex: • string array elements arrange in ascending order: • 1.take the form • 2.add listbox and one button control • source code: • private void button1_Click(object sender, EventArgs e) • { string[] nos = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" }; • var no = from n in nos orderby n ascending select n; • foreach (var v in no) • { listBox1.Items.Add(v.ToString()); • } }
  • 6. For more visit our website www.siri-kt.blogspot.com Thanks for Watching More Angular JS TutorialsMore C sharp (c#) tutorials