Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Where???
• Connection
• Query
• Execution procedure etc
Working with ADO.NET
• DataTable
• DataSet
• SqlDataAdapter etc
Working with RAM data
• Currently
o Programmer, Databiz Software Limited
o Do Outsourcing
• Previously
o Assistant Trainer of BASIS
o Newage Infotech Services Limited
o Liveoutsource Limited
What will you get from today's class?
• LINQ to Object
• LINQ to SQL
• LINQ to XML
Today's topics
• LINQ to Object
• LINQ to SQL
LINQ To Object
Initialization Expression:
Student student=new
Student();
student.Id = "001";
student.Name = "Foysal";
student.Address = "Dhaka";
Initialization Expression:
Example:
new {studentObject.Name,studentObject.Address};
Practice:
1. Get the student list who live in Shamoli.
– Get the names which has the length of more than 6
How to work well in .NET
To work better with a tool, you must know what can you do
with that tool. Remember, Language (C# for example) is
just a tool for your coding. So, you have to know what can
you do with this tool.
Another Example:
Primitive data types:
var selectedNames = from name in names
where name.EndsWith("l")
select name;
Practice:
1. Find the names which contains the string sequence of
"on"
– Find the student list who has address containing the
string sequence of "li"
Projection Operator: Select
Example:
Primitive data types:
var selectedStudents = from student in students
from course in student.CourseTaken
where course.CourseName.StartsWith("C")
select student;
User defined data types:
var selectedStudents = from student in students
from course in student.CourseTaken
where
course.CourseName.StartsWith("C")
select
new {student.Name,
course.CourseName};
Practice:
1. Find the courses which are taken by the students who
lives in Shamoli.
2. Find the course Credit of the courses which are taken by
the students whose name are 6 character long.
What else we can do with it?
There are several more operator in LINQ. Such as:
• Partitioning Operators
• Ordering Operators
• Grouping Operators
• Set Operators
• Conversion Operators
• Element Operators
• Generation Operators
What else we can do with it? (Cont.)
• Quantifiers
• Aggregate Operators
• Miscellaneous Operators
• Custom Sequence Operators
• Query Execution
• Join Operators
• Utility Routines
LINQ To SQL
Why "LINQ To SQL"?
Go back to slide 41 and then return
Questions???
Or Feel free to mail me if you have questions