Title: Microsoft .NET Framework Overview
1(No Transcript)
2?????? ?? ????? ? ADO.NET
???????????? ?? .NET Framework
http//www.nakov.com/dotnet/
???????? ?????
C MVP, MCSD.NET, MCDBA, MCT??????????
????????BSH Ltd.http//www.bsh-bg.com
3??????????
- ????????? ? ???????????? ???? ?? ?????
- ????????? ? SQL Server
- ADO.NET
- ????? ??????? ?? ??????????? ??? ?????????? ??
?????????? ? ?????????? ?? ?????? ? ???? ????? - ???-????? ????????
4?????????? ???? ?? ????? ??????????
- ?????? ?? ?????? ?? ?????
- ???????????? ???? ?? ?????
- RDBMS ???????
- ???????, ??????, ????????????? ?? ????????, E/R
???????? - ????????????
- ??????????? (constraints)
- ???????
5?????????? ???? ?? ????? ??????????
- ?????? SQL
- Stored procedures
- ??????? (views)
- ??????? (triggers)
- ??????????
6?????????? ???? ?? ?????
- ?????? ?? ?????? ?? ?????
- ?????????? (??????????)
- ???????
- ?????????? (????????)
- ???????-??????????
- ???????????? ???? ?? ?????
- ????????????? ??????????? ?? ??????? ? ??????
????? ??? (???????) - ??????? ?????? ????????????? ?????? ????????????
???????
7??????? ?? ?????????? ?? ??
- ??????? ?? ?????????? ?? ?????????? ???? ?? ?????
(????) Relational Database Management System
(RDBMS) - ?????????? ????????? ???????? ??
- ????????? / ??????? / ????????? ?? ??????? ?
?????? ????? ??? - ????????, ???????, ?????????, ??????? ? ?????????
?? ????? ?? ????????? - ????????? ?? ????? SQL
- ?????????? ?? ???????????? (??????????????)
8??????? ?? ?????????? ?? ??
- RDBMS ????????? ?? ??????? ???
- ??????? ?? ?????????? ?? ???? ?? ?????
- ??? ?????? "Database ???????"
- ??-???????? RDBMS ???????
- Microsoft SQL Server
- Oracle Database
- IBM DB2
- PostgreSQL
- MySQL
- Borland Interbase
9???????
- ????????? ????????????? ?????????? ?? ?????????,
????????? ? ?????? ? ??????. ?????? (???????
PERSONS) - ???????? ???? ??????? ?????????
- ???????? ???? ??? ? ??? (?????, ???????? ???,
???? ??? ??.)
10????? ?? ???????
- ????? ?? ??????? ? ???????? ???????????????? ??
???????? ?? ?????? (??? ? ???) - ???????? ????????? PERSONS ??? ???????? ?????
PERSONS ( id ?????, name ???????? ???,
family ???????? ???, employer ???????? ??? )
11???????? ????
- ?????????? ???? (primary key) ? ?????? ??
?????????, ????? ???????? ???????????? ????? ????
??? - ??? ?????? (????) ?? ???????? ?????? ?? ????????
?????????? ?? ??????? - ?????????? ???? ???? ?? ? ?????????? ?? ???????
??????
Primary key
12?????? (???????)
- ???????? ????? ????????? ?? ??????? ??
??????????????? primary key / foreign key
Foreign key
Primary key
Primary key
TOWN
COUNTRY
13?????? (???????)
- ???????? ???? (foreign key) ? ????? ?? ?????
(primary key) ? ????? ??????? - ???????? ????????? ??????????? ?? ??????????
- ? ??????? ????? ?? ????????? ?? ?? ??????? ??
????? ???? - ???????? ???? ????????????? (multiplicity)
- 1 x 1 ???????? ????? / ??? ?? ?????
- 1 x ????? ??????? / ???????
- ????? x ????? ??????? / ?????? ????
14????????????? ?? ????????
- ?????? 1 x 1
- 1 ????? ?? ?????? ??????? ??????????? ?? ????? 1
????? ?? ??????? ??????? - ????? ?? ???????? ???? ??????
TOWN
POPULATION
15????????????? ?? ????????
- ?????? 1 x ????? (??? ????? x 1)
- 1 ????? ?? ??????? ??????? ??????????? ?? ?????
?????? ?? ??????? ??????? - ???????? ?? ????? ?????
TOWN
COUNTRY
16????????????? ?? ????????
- ?????? ????? x ?????
- 1 ????? ?? ??????? ??????? ??????????? ?? ?????
?????? ?? ??????? ??????? ? ????????? - ????????? ?? ???? ???????? ???????
STUDENT_COURSE
STUDENT
COURSE
17?????????? ?????
- ?????????? ????? ?? ?? ???????? ???????????? ??
- ??????? ?? ?????? ???????
- ???????? ????? ?????????
- ???????????? ????? ?????? ??????????? ?? ??
- ?? ??????? ?????, ? ???? ?????????
- ???????????? ????? ?? ??????????? ???????? ????
Entity/Relationship ???????? (E/R diagrams)
18E/R ???????? ??????
?????????? ? ????????? ? Microsoft SQL Server
Enterprise Manager
19E/R ???????? ??????
?????????? ? ????????? ? PLATINUM ERwin
20E/R ???????? ??????
?????????? ? ????????? ? fabFORCE DB Designer
21??????????? ?? E/R ??????
- E/R ?????????? ?? ???????? ? ??????????? ??
?????????? ?? ????? (Data Modeling Tools) - Microsoft Visio
- Oracle Designer
- Computer Associates Erwin
- SQL Server Enterprise Manager
- IBM Rational Rose
- theKompany Data Architect
- fabForce DBDesigner (GNU GPL ?????? ? ??????? ???
?? Windows ? Linux)
22????????????
- ?????????????? ?? ???????????? ????? ????????
??????????? ?? ????? - ????????????????? ????? ???????? ????? ??????????
23????????????
- 1-?? ???????? ?????
- ??????? ???? ???????? ???
- ???????? ? ???????? ?? ???????? (????????)
????????? - ???? ?????????? ?? ????? ? ??????? ?? ???? ???
- ????????? ? ???????? ???? ?? ????? ???????
24????????????
- 2-?? ???????? ?????
- ??????? ???????????? ?? 1-?? ???????? ?????
- ? ????????? ???? ??????, ???????? ?? ???? ??
????????? ???? (??? ? ???????? ?? ??????? ??????)
E-mail-?? ?????? ?? ??????
?????? ?????? ?? ???????
25????????????
- 3-?? ???????? ?????
- ??????? ???????????? ?? 2-?? ???????? ?????
- ???????????? ??????????? ????? ???????? ??
"?????? ?????? ?? ????????? ????"
26????????????
- 4-?? ???????? ?????
- ??????? ???????????? ?? 3-?? ???????? ?????
- ? ????????? ??? ???-????? ???? ??????, ?????????
??????? ? ??????? ???????? ?????????
(multi-valued attribute) ?? ???? ????
???? ????? ??? ????? ?????
???? ????? ??? ????? ??????
27????????????
- ?????? ?? ????????????? ????? (? 4-?? ????????
?????)
PRODUCT
VENDOR
CATEGORY
STORE
TOWN
28Constraints
- ????????????? (constraints) ??????? ???????, ??
???????, ????? ?? ????? ?? ????? ?????????? - ??????????? ?? ???????? ???? (primary key
constraint) - ?????????? ???? ? ???????? ?? ????? ?????
- ??????????? ?? ???????? ???? (unique key
constraint) - ??????????? ? ?????? ?????? (??? ????? ??????) ??
????????
29Constraints
- ??????????? ?? ?????? ???? (foreign key
constraint) - ?????????? ? ?????? ?????? ? ???? ?? ?????
??????? - ??????????? ?? ???????? (check constraint)
- ??????????? ? ?????? ?????? ?????????? ??????
??????? - ????????
- (hourgt0) AND (hourlt24)
- name upper(name)
30???????
- ????????? ????????? ????????? ?? ??????? ??
???????? ? ?????? ?????? ??? ????? ?? ?????? - ??????? ?? ??? ?????? ???????
- ?????????? ?? ???-????? ? B-??????? ???
???-??????? - ????? ?? ????? ?????? (????? ?????????) ???
???????? - ?????????? ? ??????????? ?? ??????????? ??????? ?
??-?????
31?????? SQL
- SQL (Structured Query Language)
- ?????????????? ???????????? ???? (????????) ??
??????????? ?? ?????????? ???? ?? ????? - SQL-92 ????????? ?? ?????? RDBMS
- SQL-99 ??????? ??? ??????
- SQL ????????
- ?????????, ???????, ????????? ?? ??????? ? ?????
?????? ? ?? - ???????, ?????????, ????????, ??????? ? ?????????
?? ?????
32?????? SQL
- SQL ?? ?????? ??
- DDL Data Definition Language
- ??????? CREATE, ALTER, DROP
- DML Data Manipulation Language
- ??????? SELECT, INSERT, UPDATE, DELETE
- ?????? ?? SQL SELECT ??????
SELECT TOWN.NAME, COUNTRY.NAME FROM TOWN,
COUNTRY WHERE TOWN.country_id COUNTRY.id
33Stored procedures
- ????????? ?? ???? ???? (???????? ?????????,
stored procedures) - ????????? ???, ????? ?? ????????? ? ????? ??????
?? ???? ????? - ??????? ????? ??-????? ?? ?????? ???
- ??????? ?? ??????? ????????
- ????? ?? ??????? ?????????
- ????? ?? ?????? ????????
- ???????? ????????
- ?????????? ?? ?????? (record set)
34Stored procedures
- ????????? ?? ???? ???? ?? ????? ?? ????,
?????????? ?? SQL - T-SQL SQL server
- PL/SQL ? Oracle
- ?????? ?? ????????? ?? T-SQL
CREATE PROCEDURE sp_GetInventory _at_location
varchar(10)AS SELECT Product, Quantity FROM
Inventory WHERE Warehouse _at_location
35??????? (views)
- ????????? ????????????? ????????? SQL SELECT
??????, ????? ?? ????????? ???? ??????? - ?????????? ????????? ??? ???????? ?? ?????? SQL
?????? - ???????? ?? ?? ???? ????????? ?? ???????????
- ?? ????? ?????????? ?? ?? ????? ????? ??? ?????
??????? - ????? ?? ?? ????? ???? ??? ????? ???????
(???????????? ?? ???????)
36??????? (views) ??????
T_COMPANY
T_TOWN
T_COUNTRY
- CREATE VIEW V_BG_COMPANY AS
- SELECT
- T_COMPANY.id AS id,
- T_COMPANY.company AS company
- FROM T_COMPANY INNER JOIN
- (T_TOWN INNER JOIN T_COUNTRY ON
- T_TOWN.country_idT_COUNTRY.id)
- ON T_COMPANY.town_idT_TOWN.id
- WHERE
- T_COUNTRY.country"????????"
V_COMPANY_BG
37??????? (triggers)
- ????????? (triggers) ?? ????????? ?? ???? ????,
????? ?? ????????? ??? ??????? ???????, ???????? - ??? ???????? ?? ?????
- ??? ??????? ?? ?????
- ??? ????????? ?? ?????
- ????????? ????? ?? ????????? ????????????
????????? ?? ??????? - ??????? ?? ??????? ??? ????????
- ????????? ?? ?????? ? ???????
38??????? ??????
- ????? ??????? ? ????? ?? ?????
- ??????, ????? ??? ???????? ?? ???? ????? ??????
"Ltd." ??? ????? ?
CREATE TABLE T_COMPANY( id int NOT NULL, name
varchar(50) NOT NULL)
CREATE TRIGGER trg_COMPANY_INSERT ON COMPANY
FOR INSERT AS UPDATE COMPANY SET name name
' Ltd.' WHERE id (SELECT id FROM inserted)
39??????????
- ???????????? ?? ????????????????? ?? ????????
(?????? ??? ?????? ?????), ????? ?? ??????????
???????? - ??? ?? ?????????? ???????? ?????? (???? ????
????) - ??? ????? ?? ?????????? ?? ?? ????????? ??????
- ??????
- ??????? ??????????? ?? ???? ?? ???? ?????? ?
????? - ??? ????????? ??? ????????? ?? ?????? ????????,
??????? ?????? ????????
40?????????? ??????
- ????? ??????? ? ??????? ??????
- ?????????? ?????????? ??? ???????? ?? ???? ??
?????? ?? ??????
CREATE TABLE ACCOUNT( id int NOT NULL,
balance decimal NOT NULL)
CREATE PROCEDURE sp_Transfer_Money( _at_from_acc
int, _at_to_acc int, _at_ammount decimal )
AS (???????? ??????????)
41?????????? ??????
BEGIN TRANSACTION UPDATE ACCOUNT set balance
balance - _at_ammount WHERE id _at_from_acc IF
_at__at_rowcount ltgt 1 BEGIN ROLLBACK TRANSACTION
RAISERROR ('Invalid source account!', 16, 1)
RETURN END UPDATE ACCOUNT set balance balance
_at_ammount WHERE id _at_to_acc IF _at__at_rowcount ltgt 1
BEGIN ROLLBACK TRANSACTION RAISERROR
('Invalid destination account!', 16, 1)
RETURN END COMMIT TRANSACTION
42?????????? ? ????????
- ???????????? ????? ?? ????????? ???? ?? ????????
(isolation levels)
43????????? ? SQL Server
- ??????? ?? SQL Server
- ??????? ?? ???????????? ?????
- ?????? ?? SQL Server
- ?????? ?? SQL Server ?????????? ???
System.Data.SqlClient - ???????? ?????????? ?? SQL Server 2000
- ???????????? ?? SQL Server 2000
44???????? ?????????? ?? SQL Server 2000
- ??????
- MSSQLSERVER
- SQLSERVERAGENT
- MSSQLServerADHelper
- MSSQLServerOLAPService
- ???????????
- Enterprise manager
- Query Analyzer
- DTS
- Profiler
- SQL XML
- Analysis Manager
45???????????? ?? SQL Server
- ????????? ?????
- Visual Studio .NET 2002/2003
- ????????? ?? DB ?????? ??? VS.NET 2003
- Query Analyzer
- ?????? ??? ????????? ?????????
- ??????????? ?? ??????
46???????????? ????????? ?????
- Query Analyzer
- Visual Studio .NET 2003
- DB Projects
- ???????????? ?? T-SQL (????????? ????????? ???
VS.NET 2003)
47????????? ? T-SQL
- ?????? ???????
- Data Definition Language (DDL)
- ????????? ? ?????????? ?? ???????? ? ?????? ??
????? - Data Manipulation Language (DML)
- ?????? ? ??????? ? ???????? ??????????? ?? ?
?????? ?? ????? - DataBase Console Commands (DBCC)
- ???????? ????????? ?????????
48Data Definition Language (1/2)
- ????????? ??? SQL-92 DDL ??????? ??????????
?????????? ?? SQL Server 2000 - ??????? ?? ?????????? ? ?????? ???
- ???? ?? ?????
- ???????
- ???????
- View-??
- ????????? ?????????
- ? ??.
49Data Definition Language (2/2)
- ?????? ???????
- ?????????? ?? ??????
- CREATE, ALTER, DROP
- ??????? ?? ??????
- GRANT
- DENY
- REVOKE
50?????? ???????
- ?????????? ?? ??????
- CREATE
51?????? ???????
- ?????????? ?? ??????
- ALTER
52?????? ???????
53?????? ???????
- ?????????? ?? ??????
- DROP
54?????? ???????
- ??????? ?? ??????
- GRANT
- DENY
- REVOKE
55Data Manipulation Language
- SELECT
- SELECT FROM Users
- INSERT
- INSERT Users (FirstName, LastName, phone, mobile,
email) VALUES ('Branimir', 'Giurov', '797461',
'887925209', branimir_at_abv.nospam.bg') - UPDATE
- UPDATE Users SET emailbranimir_at_dir.nospam.bg'WH
ERE UserID 1 - DELETE
- DELETE Users WHERE UserID1
56Data Manipulation Language
- SELECT
- ?????????SELECT select_listINTO
new_table_nameFROM table_listWHERE
search_conditionsGROUP BY group_by_listHAVIN
G search_conditionsORDER BY order_list ASC
DESC
57Data Manipulation Language
- INSERT
- ?????????INSERT INTO (ColumnList) VALUES
(ValuesList) - ??????INSERT Users (FirstName, LastName, phone,
mobile, email) VALUES ('Branimir', 'Giurov',
'797461', '887925209', branimir_at_abv.nospam.bg')
58Data Manipulation Language
- UPDATE
- ?????????UPDATE table_name SET colnamevalue,
colname1value1WHERE condition - ??????UPDATE Users SET emailbranimir_at_dir.nospa
m.bg'WHERE UserID 1
59Data Manipulation Language
- DELETE
- ?????????DELETE FROM TableName WHERE
Condition - ?????? DELETE Users WHERE UserID1
60DBCC
- DBCC - Database Console Commands
- ?????????? ?? ?????????? ?? ??????????? ??
?????????? - ?????????
- ?????????
- ?? ?????? ????? ???? ?? ?????
- ??????? ? ??????? ?????
- ???????? ?? ???????
- ????????? ?? ?????? ?? ?????, ?? ???? ????,
???????, ?????? ? ??.
61????? ??-???????? DBCC
- ?????????
- DBCC DBREINDEX
- DBCC DBREPAIR
- DBCC INDEXDEFRAG
- DBCC SHRINKDATABASE
- DBCC SHRINKFILE
- DBCC UPDATEUSAGE (sysindexes)
- ???????? ?? ???????
- DBCC OPENTRAN
- DBCC INPUTBUFFER
- DBCC OUTPUTBUFFER
- DBCC PROCCACHE
- DBCC SQLPERF ( LOGSPACE )
- DBCC USEROPTIONS
62????? ??-???????? DBCC
- ?????????
- DBCC CHECKALLOC
- DBCC CHECKCATALOG
- DBCC CHECKCONSTRAINTS
- DBCC CHECKDB
- DBCC CHECKFILEGROUP
- DBCC CHECKIDENT
- DBCC CHECKTABLE
- ?????
- DBCC dllname(FREE)
- DBCC HELP
- DBCC PINTABLE
- DBCC TRACEON / TRACEOFF
- DBCC UNPINABLE
63???????? ????????? ?????????
- ????????? ????????? (Stored Procedures)
- ????????? ? ????? ?? ??????
- ????????? ?? ????????? - sp_
- ????????? ????????? ????????? (Extended Stored
Procedures) - ????????? ? ????? ?? ??????
- ????????? ?? ????????? - xp_
64???????? ????????? ????????? - ?????????
- CREATE PROC procedure_name _at_parameter
data_type VARYING default
OUTPUT ,...n AS sql_statement
...n - ??????CREATE PROC usp_InsertAuthor _at_au_id
varchar(11), _at_au_fname varchar(20), _at_au_lname
varchar(20)ASINSERT Authors (au_id,
au_fname, au_lname, contract) VALUES (_at_au_id,
_at_au_fname, _at_au_lname, 1) - DECLARE _at_au_id varchar(20) SET _at_au_id (SELECT
_at__at_identity) SELECT _at_au_idGO -
65????????????
- ?????????? ?? T-SQL
- DDL
- DML
- DBCC
- ????????? ?????????
66ADO.NET
- ?????? ?? ?????? ? ???????
- ???????
- ?????????
- ?????????? ?? ??????? ?????
- ?????????? ?? ????????? ?????
- ?????? ????? ADO.NET ? XML
- DataView ????
67?????? ?? ?????? ? ?????
- ??????? ?????
- ?????? ?? ??????????
- ??????????????
- ????????
- ????????? ?????
- ?????? ?? ??????????
- ?????????????? ? ??????????
- ???????
- ??? ??????
- ?????????? ? XML
68??????? ?????
- ?????????? ?? ?????? ?? ????? ? ????? ? ?????
?????? ??? ?????? ?? ????????? ?? ?????
69??????? ????? - ??????????
- ??????? ? ??-????? ?? ?????????????
- ???????? ????? ????????????? ?????? ?? ?????????
??-????? - ??-????? ?????????? ?? ?????? ? ???????? ??????
?? ???????
70??????? ????? - ???????????
- ????? ?? ????????? ??????? ??????
- ???????? ??? ????? ?? ????????????
71????????? ?????
- ???????????? ?? ??????? ?? ??????????? ??????? ??
?????????? ?? ??????? ?? ?????? ??????? ??? ????,
????? ? ????????
72????????? ????? - ??????????
- ??????? ???? ?? ?? ???????, ?????? ??? ?????, ? ?
?????????? ????? ?? ?????? ??? ?????? ?
??????????? ???? ?? ????? - ????? ??????????? ????? ?? ????????? ????????
????????????? - ?????????????? ? ????? ??-?????
73????????? ????? - ???????????
- ??????? ?? ?????? ?? ??????
- ??????????? ????? ?????????? ?????? ?????? ?? ??
??????? ? ???????????? ??????
74???????? ?? ????????????
- ?????????? ??????????
- ???-????? ???? ?????????? ?????? ???????????
- ?????? ?????????? ???????? ?? MS Access
- ??????????
- ?????? ?????????? ?? ?? ???? ?????
- ???????????
- ??????? ?? ???????????????? ??????? ?????????????
75???????? ?? ????????????
- ????????? ?????????? (??????-??????)
- ??????????????? ????????? ? ?????? ????????? ??
????????? ?? ???? ????? - ??????? ?? ??????? ?? ???????? ??? ??????? ????
- ??????????
- ??? ????????? ?? ????????????????
- ???????????
- ?????? ???????, ???????? ? ??????????? ?? ?????
???? ??????? - ???????
- SQL Server
- Exchange 2000/Outlook XP
76???????? ?? ????????????
- ????????? ??????????
- ????? ??? ?????? ? ? ??????? ????
- ??????????
- ????? ????????????? ?? ???????????????? ?????
????????????/?????? ??????/?????? ?? ??????? - ???????????
- ?????? ?????????
- ??????? ??-?????????? ?????? ?? ?????????? ?
?????????? ?? ??????? ?? ?????????. ??????
??????????? ?? ?????. - ???????
- ASP/ASP.NET ??????????
77???????? ?? ????????????
- ??????????? ??????????
- ??????? ? 3 ????????? ????
- ?????????? ?? ????????? ?? ??? ?????? ?? ????????
?? ?????????????? - ??????????
- ?????????? ?? ???????? ?????????? ?? ?????????
???????????????? ???? ???????? ????????? - ???????????
- ????? ?????? ?????? ?? ?????????? ? ?????????? ??
??????? ?? ??????? ??????. - ???????? ?????? ????????? ? ??-?????? ??????? ??
??????????
78? ??????? ?? ???????
????????????, ????????????
79??????????? ?? ADO.NET
- ????? ? ADO.NET?
- Namespace-? ?????????? ?? ?????? ? ADO.NET
- ???????? ?? ADO ??? ADO.NET
- ??????? ????? ?? ADO.NET
- ?????????? ?? ADO.NET ? ???????? ?????
- ?????????? ?? ADO.NET ? ?????????? ?????
80????? ? ADO.NET
- ????? ?? ??????? ?? ?????? ? ?????
- ????????? ?? ADO
- ??????? ?????? ?????????? ?? ???????? ? ?????? ?
?????????? ????? - ????????? ????? ?? ?????? (?????????? ? XML)
- ????? ?? ???????, ??????????, ????????? ?
?????????? ?? ?????? ?? ??????? ???? ?????? .NET
???????? ??????????
81Namespace-? ?? ADO.NET
- Namespace-?
- System.Data
- System.Data.Common
- System.Data.SqlClient
- System.Data.OleDb
- System.Data.SqlTypes
- System.Xml
- ???????????? ?? ?????? ?? SQL Server
82???????? ?? ADO ??? ADO.NET
ADO.NET
XxxConnection
Connection
XxxTransaction
Command
XxxCommand
Recordset
DataSet
XxxDataReader
XxxDataAdapter
83??????? ????? ?? ADO.NET
DataSet
DataSet
Odbc .NET Data Provider
Oracle .NET Data Provider
OleDb .NET Data Provider
SQL Server .NET Data Provider
84Data provider ??????? ? ADO.NET
- Data Provider ????????? ?????? ?? ?????? ?
???????? ???? ????? - ?????????? ????????????? ????????? ????????
????????? ?? ?????? ?? ??????? - ? ADO.NET ??? ??????? ??????? Data Provider-a
- SqlClient
- OleDB
- Odbc
- Oracle
85?????????? ?? ADO.NET ? ???????? ?????
- ??????? ?? ?? ??????? ?? ????????? ?? ????????
- ???????? ?? ??????
- ?????????? ?? ??????? (???????)
- ?????? ? ?????? (???????? ?? ????????) ???? ?????
(SqlDataReader) - ????????? ?? ?????a
- ????????? ?? ????????
SqlDataReader
SqlCommand
SqlConnection
86?????????? ?? ADO.NET ? ?????????? ?????
- ??????? ?? ??????? ? DataSet ????? ? ???????? ???
??????? ?? ????????????? - ???????? ?? ??????
- ??????? ?? DataSet
- ????????? ?? ????????
- ?????? ??? DataSet-a
- ???????? ?? ??????
- ???????? ?? ??????? ?? ??????? ?? ???????
- ????????? ?? ????????
DataSet
SqlDataAdapter
SqlConnection
87ADO.NET ? XML
- ADO.NET ? ????? ??????????? ? XML
- ?????????? ?a ADO.NET ? ????????? ????????
?????????? ?a SQL ??????
????????? ?? ??? ??????
???????? ?? SQL ??????
XML
DataSet
??????? ????????? XML
?????? ?? ?????????? ?????????
DataSet
88?????? ? ???? ?? ?????
- SqlClient Data Provider
- ?????????? ? ?????? ??? SqlConnection
- ?????????? ?? ???????????? ?????????? ??? ??????
??? SqlConnection - Connection Pooling
89SqlClient Data Provider
- SqlConnection ??????????? ???????? ??? SQL
Server - SqlCommand ????????? ??????? ????? SQL Server-?
???? ???? ???????????? ?????? - SqlDataReader ????? ?? ?????? ?? ????? ?? SQL
Server-?. ??????? ?? ???????? ?? ?????????
??????? - SqlDataAdapter ???????-? ????? ?? ?????? ?
DataSet ??????. ???? ?? ?? ????? ??? ?? ?????????
?? ???????? ? ??????
90?????????? ? ?????? ??? SqlConnection
- ??????? ?? ????????? ? SQL Server 2000
- ???????? ??? ?? ?????? ? ???? ?? ?????
(ConnectionString)
91??????? ?? ????????? ? SQL Server 2000
- ?????? ????????????
- Windows
- ??????? ????????? ? ??????????
- ????????? ?? ??????
- ???????? ?? ??????
- ?????????? ?? ???????
- ??????? (Windows ? SQL)
- ??????? ?? ???????????? ? ???????? ??????
- ????? ??????? ? ?????????
92???????? ??? ?? ?????? ? ???? ?? ?????
(ConnectionString)
- ???????? ??????????? ?????????? ?? ?????????????
?? ?????? ? ?????? - ??????? ?????????
- Provider
- Data Source
- Integrated Security
- User ID/Password
- Persist Security Info (False)
- ??????Serverlocalhost databasePubs
Integrated Securitytrue Persist Security
Infofalse
93???????????? ?????? ??? SqlConnection
- ?????????? ?? ConnectionString
- ?????????? ?? SqlConnection
- ????????????? ?? SqlConnection ?????
- ???????? ?? SqlConnection
- ???????? ?? ??????????? ?? ????????
94??? ?? ???????? ??? SqlConnection
- ??????????? ???????? ? ????????? ?? ????????
- Open ? Close ??????
- ?????????? ???????? ? ????????? ?? ????????
- ???????? ? ???? ??? ?????? ??? DataAdapter-?
- ?????????? ?? Dispose ??????
- ???????? ???????? ?? connection pool-?
95????????? ?? ????????? ?? SqlConnection
- ??????? ?????????? ?? ????????
- StateChange ? InfoMessage
- StateChangeEventArgs ????
- ???? ?????????? ?? ???? ????? ?? ? ??????? ???
???????? ? ?????? - CurrentState ? OriginalState ?????????? ?? ?????
- SqlInfoMessageEventArgs
- Errors SqlErrorCollection ???????? ?? ?????????
?? ?????? ? ?????????????? - Message ??????????? ?? ??????
- Source ???? ? ?????????? ????????/??????????????
??
96????????? ?? StateChange ??????? - ??????