Title: ADO'NET
1????? ?? ?????? ??????? ADO.NET
MCSD Doron Amir
www . dorronamir . com
2??? ????? ?????? ?
????? ?????? ????? , ????? ,????? , ????? ,
????? ???' ?? ?????? ????
?????? ( ???? ?????? ).
Disconnected Data Architecture
Application
DB
ADO.NET ?????? ?? ?????????? ?????? ?????? ??
??????? ???? ??????? ???? ??? ????? ?????? ?????
?????? ??????.
3??? ????? ? -? ADO.NET
Data Provider
DataSet
Connection
Data Adapter
DataReletion
SelectCommand
Command
DB
DataTable
InsertCommand
DataReader
UpdateCommand
DeleteCommand
XML
4????? ? ADO.NET
DataTable ??????? ?????? ???? .
DataSet 1(???? ???? ??? ?? ???? ?? ?????????
???? DataTable
2( ???? ???? ???? ?????? ??? ??????? ?-
DataRelation Objects
Data Provider ???? ?????? ???????? ???????
?????? ??? ????
?????? . ???? ??? ????? ?????? ???? ???? ??????.
1) ???? ????
?????? ???? OleDb 2
) ???? ???? ?????? ???? SQL Server
5DataTable
0
1
2
1112
Moshe
Levi
1113
Sarit
Mor
1114
Lilah
Tibon
6DataSet
0
1
2
11
1112
Moshe
Levi
DataReletion
1113
Sarit
Mor
1114
Lilah
Tibon
DataTable(1)
0
1
2
1112
23
Tel-Aviv
1113
32
Haifa
1114
20
ramat gan
DataTable(2)
7Data Provider
Connection ????? ?? ???? ???? ???????
Command ????? ????? ?????? ???? ??????? ?????
????? ?? ????? ??????.
DataAdapter ????? ????? ???? ???? ?? ? DataSet
??? ? DataBase
DataReader ????? ????? ????? ?? ?????? ?? ??
?"? Disconnected
System.Data.OleDb ??????? ?????? ?? ?????? ????
???? OleDb
System.Data.SqlClient ??????? ?????? ?? ??????
???? SQL Server
Data Provider
Data Adapter
DataSet
DataReader
SelectCommand
InsertCommand
DataReletion
Command
UpdateCommand
DataTable
Connection
DeleteCommand
8Data Reader
?- DataReader ???? ????? ?????? ?????? ??? ????
??? ???? ?? ??????? ??????? , ??? ??? ???? ??
??????? ????? ?????
Customers
9Why Command ?
???? ????? ???? ?????? ?????? ?????? ??? ???
???????
ExecuteNonQuery Method ????? ????? ??????
??????
????? ???? ?????? ???? ??????? ?"? ????? INSERT
10Why Command ?
ExecuteScalar Method ????? ???? ???? ????
???????
11 Data Adapter
Data Adapter ????? ??? ??? ??????? ???????? ?
DataSet
Fill Method ???? ?? ?????? ?? ??????
SelectCommand
- ?????? ? Data Adapter
- SelectCommand ????? ????? ???? ???????(Fill
Method) - InsertCommand ?????? ????? ( Update Method )
- DeleteCommand ?????? ????? ( Update Method )
- UpdateCommand ?????? ????? ( Update Method )
12 Data Adapter
Data Set
Update
Fill
Data Adapter
SelectCommand
DB
DeleteCommand
UpdatetCommand
InsertCommand
13Disconnected
14Typed DataSet
dataSet.Tables0.Rows11
Regular
????? ???????
???? (2)
????? (2)
id
name
age
0,0
0,1
0,2
1,0
1,1
1,2
2,0
2,1
2,2
dataSet.Customers1.Name
Typed
?? ?????
???? (2)
????? (2)
15Typed DataSet
16Code
17????? ?? ?????? ??????? ADO.NET