Professional Documents
Culture Documents
UNIT-5
UNIT-5
UNIT-5
NET
UNIT 5
INTRODUCTION
• What is data ?
• What is Database?
• What is Relational database?
• What is RDBMS?
• What is SQL?
INTRODUCTION
What is ADO.NET ?
• Its is a part of .Net framework technology that allows
us to access and modify data from different data
source.
• It support many types of data source such as Oracle ,
SQL server…etc
• The .Net framework provides a number of data
provider that we can use.
• ADO.NET provide a bridge between the front end
and the backend database.
ASP.NET Data Source Controls
Name Description
SqlDataSource Connects data-binding controls to
SQL databases
AccessDataSource Connects data-binding controls to
Access databases
XmlDataSource Connects data-binding controls to
XML data
ObjectDataSource Connects data-binding controls to
data components
SiteMapDataSource Connects site navigation controls to
site map data
What is ADO.NET ?
Your Application
OLE DB
Provider
SQL Server
Database Database
It also provides support for XML data access and it has a rich
object model.
ADO.NET architecture
Connected Model Disconnected Model
.Net Application .Net Application
Open Connection
Manipulate data
Retrieve Results
Open connection
Close connection
Update tables
Close connection
Order
Payroll Processing
database database
ADO.NET architecture
Component
DataSource component
Data Access - LINQ
What is LINQ?
Language Integrated Query (LINQ, pronounced
"link").
LINQ is a uniform programming model for
querying and manipulating data with a
consistent model from any data source.
LINQ is just another tool for embedding SQL
queries into code.
Extends powerful query capabilities to C#,
VB.NET languages.
LINQ Architecture
C# VB Others…
<book>
<title/>
<author/>
<price/>
</book>
Objects
XML
Relational
LINQ Features
• Language Integration
• Single general purpose Declarative Programming
• Standard Query Operators that allow
• traversal, filter, and projection operations
• Transparency Across Different Type Systems
• Query expressions benefit from
– rich metadata
– compile-time syntax checking
– static typing
– IntelliSense
The Syntax
from id in source
join id in source on expr equals expr
let id = expr
where condition
orderby ordering, ordering, … }
select expr | group expr by key
Extension
methods
Query Operators
Project Select <expr>
Filter Where <expr>, Distinct
Test Any(<expr>), All(<expr>)
Join <expr> Join <expr> On <expr> Equals <expr>
Group Group By <expr>, <expr> Into <expr>,
<expr>
Group Join <decl> On <expr> Equals <expr>
Into <expr>
Aggregate Count(<expr>), Sum(<expr>), Min(<expr>),
Max(<expr>), Avg(<expr>)
Partition Skip [ While ] <expr>, Take [ While ]
<expr>
Set Union, Intersect, Except
Order Order By <expr>, <expr> [ Ascending |
Descending ]
LINQ to Objects
• It is the use of LINQ queries with any IEnumerable or
• IEnumerable(T) collection directly, without the use of an
intermediate
• LINQ provider or API such as LINQ to SQL or LINQ to XML.
• It allows query any enumerable collections such as
– List(T),
– Array, or
– Dictionary(TKey, TValue).
• The collection may be user-defined or may be returned by a .NET
Framework API.
LINQ to Objects