ATKA1D 'NETohjelmointi ADO'NET - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

ATKA1D 'NETohjelmointi ADO'NET

Description:

Notes by Helia / Martti Laiho, Tuomo Ketom ki, 2002 .NET Data Provider ... Data Providers implement object classes of their own: SQL .NET Provider: Sql object ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 27
Provided by: Hel51
Category:

less

Transcript and Presenter's Notes

Title: ATKA1D 'NETohjelmointi ADO'NET


1
ATKA1D .NET-ohjelmointi ADO.NET
2
ADO.NET dokumentaatio
3
ADO.NET Data Providers
Source Understanding .NET David Chappell
Managed Code
System.Data.SqlClient
SQL .NET Data Provider
SQL Server
System.Data.OleDb
Client
OLE DB .NET Data Provider
OLE DB Provider
Other DBMS
System.Data.Odbc
ODBC Driver
Other DBMS
ODBC .NET Data Provider
CLR
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
4
System.Data.OleDb
5
System.Data.Odbc
6
ADO.NET Data Provider
Source Understanding .NET David Chappell
.NET Data Provider
Client
Connection
Parameters
Command
Rows
DataReader
DBMS
DataAdapter
DataSet
  • SQL .NET Provider (for SQL Server)
  • OLE DB .NET Provider
  • ODBC .NET Provider

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
7
ADO.NET Data Provider Objects
Source Understanding .NET David Chappell
Generic objects with interfaces, versions
depending on the Data Provider
.NET Data Provider
Client
.ConnectionString .Open .Close
Transaction
.Commit .Rollback
Connection
.BeginTransaction
Parameters
.CreateCommand
.ExecuteNonQuery
Command
Object
.ExecuteScalar
.ExecuteReader
.CommandText
DBMS
Rows
DataReader
IDataReader
.Read .Getlttypegt
DataSet
DataAdapter
  • Data Providers implement object classes of their
    own
  • SQL .NET Provider Sqlltobjectgt
  • OLE DB .NET Provider OleDbltobjectgt
  • ODBC .NET Provider Odbcltobjectgt

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002-2003
8
System.Data.SqlClient SqlConnection
9
SqlCommand
10
parameters
11
SqlParameter
12
SqlTransaction
13
SqlDataReader
14
SqlError
15
SqlException
16
Accessing Data with DataSets
Source Understanding .NET David Chappell
1) .Fill(DataSet, TableX)
SQL Server
SQL .NET Data Provider
3) Return DataTable

SqlDataAdapter
DataSet
SelectCommand
DataRelation
2) Execute query
Table X
Table Y
OLE DB .NET Data Provider
Oracle
OleDbDataAdapter
6) Return DataTable
SelectCommand
5) Execute query
4) Fill(DataSet, TableY)
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002-2003
17
.. Updating Database with DataSet
Source Understanding .NET David Chappell
1) .Update(DataSet)
.NET Data Provider
CommandBuilder

DataAdapter
2) Execute commands
DataSet
InsertCommand
DBMS
Table X
UpdateCommand
DeleteCommand
A DataSet cannot itself maintain an open
connection to any underlying database
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
18
System.Data.Common
19
SqlDataAdapter
20
SqlCommandBuilder
21
System.Data DataSet
22
.. DataSet
23
Using DataSets with XML-Defined Data
Source Understanding .NET David Chappell
XML string
Employees.XML
.GetXml
.ReadXml
ltemployeesgt ltemployeegt
ltnamegtBoblt/namegt ltagegt36lt/agegt
lt/employeegt ltemployeegt
ltnamegtCaseylt/namegt lt/employeegt
lt/employeesgt
DataSet
Serializing
Employee Name Age
.WriteXml
Bob 36 Casey Null
.ReadXmlSchema
Employees.XSD
.WriteXmlSchema
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002-2003
24
Synchronizing with XmlDataDocument
Source Understanding .NET David Chappell
Relational view
DataSet
Hierarchical view
XmlDataDocument
Table X
Table Y
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002-2003
25
XmlDocument
26
ADO.NET DataSet Object Model
FCS Partners
DataSet
.Select
Tables
DataTable
Columns
Relations
DataColumn
Rows
DataRelation
DataRow
Constraints
Constraint
ExtendedProperties
ParentRelations
DataRelation
ChildRelations
DataRelation
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
Write a Comment
User Comments (0)
About PowerShow.com