1. Trang chủ
  2. » Giáo án - Bài giảng

Chương 3 Windows Database Applications

7 180 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Nội dung

1 Chapter Chapter Chapter Chapter 3 33 3 Windows Database Applications 2 Universal Data Access (UDA) Universal Data Access (UDA)Universal Data Access (UDA) Universal Data Access (UDA) Microsoft’s strategy for accessing data for multiple providers Goal is to access any type of data from any application on any type of computer 3 OLEDB OLEDBOLEDB OLEDB Technology designed to implement the UDA concept Standardized interface that allows reference to data from any source using the same programming tools 4 From DAO To ADO.NET From DAO To ADO.NETFrom DAO To ADO.NET From DAO To ADO.NET  Data Access Objects (DAO 1-tier ) enabled programmers to access local databases in the Microsoft Jet Database Engine format, which were primarily Indexed Sequential Access Method (ISAM) files.  After DAO came RDO. Remote Data Objects (2-tier)  After RDO came ADO. ActiveX Data Objects (ADO 1 to n-tier) ). These data access technologies were designed for a client / server paradigm. However the tendency of distributed computing forced the development of a new technology to solve the problems of data manipulation on a n- tier architecture. ADO.NET is the evolution of ADO and its components have benn designed to function properly on a n-tier architecture. 5 ADO.NET ADO.NETADO.NET ADO.NET ActiveX Data Objects    ADO ActiveX Data Objects    ADO  ADO.NET latest database object model  Allows CSharp programmers to use a standard set of objects to refer to data from any source  .NET approach uses disconnected datasets with common data representation (data types) from multiple sources 6 ADO.NET Components ADO.NET ComponentsADO.NET Components ADO.NET Components  Data Providers – manipulate the data using SQL statements or stored procedures  SQLClient    for SQL Server  OleDbClient    for all other database formats  An ODBC provider is available for download 7 Data Provider Objects Data Provider ObjectsData Provider Objects Data Provider Objects  Connection object (OleDbConnection)– link to a data source  DataAdapter object(OleDbDataAdapter) – handles retrieving and updating data in a DataSet object  Command object (OleDbCommand) – storeprocedure and executes SQL statements  DataReader object (OleDbDataReader) –  for read-only access 8 ADO.NET Components ADO.NET ComponentsADO.NET Components ADO.NET Components  DataSet Objects  holds a copy of the data in memory  Dataset objects can be populated with data from many sources  Regardless of the data source, code handles DataSet objects the same  Dataset objects hold one or more DataTable objects 9 CÀI ðẶT MSDN (Help) Mô Hình Kết Nối Connection Data Adapter Data Source DataSet Web Form Windows Form Connection Data Source Windows Form Command Data Adapter DataSet Connection Windows Form Data Adapter DataSet DataView Data Source Connection Windows Form Command Data Reader Data Source 10 NET Data Provider Objects NET Data Provider ObjectsNET Data Provider Objects NET Data Provider Objects SelectCommand InsertCommand UpdateCommand DeleteCommand Connection .NET Data Provider Command Data Adapter DataReader 11 The DataSet Object Model The DataSet Object ModelThe DataSet Object Model The DataSet Object Model DataSet DataTable Collection DataTable DataRowCollection DataColumnCollection ParentRelations ChildRelations ConstraintCollection DataView DataRelationCollection 12 The DataSet Object Model The DataSet Object ModelThe DataSet Object Model The DataSet Object Model 13 DataTable Characteristics DataTable CharacteristicsDataTable Characteristics DataTable Characteristics  A primary key field (or combination of fields) uniquely identifies each record  A relational database contains multiple tables  Relationships between tables are established using a foreign key 14 Multitier Applications Multitier ApplicationsMultitier Applications Multitier Applications Data Retrieval Data storage Business Object Validation Calculations Business logic Business rules User Interface Forms Controls Menus Data TierBusiness TierPresentation Tier 15 Multitier Applications Multitier ApplicationsMultitier Applications Multitier Applications  Presentation tier    the user interface  Business tier    class(es) that handle the data  Calculations  Validation to enforce business rules  Data tier    retrieving and storing the data in a database 16 Display the DataSet in the DataGrid Display the DataSet in the DataGridDisplay the DataSet in the DataGrid Display the DataSet in the DataGrid 17 Display the DataSet in the DataGrid Display the DataSet in the DataGridDisplay the DataSet in the DataGrid Display the DataSet in the DataGrid 18 Display the DataSet in the DataGrid Display the DataSet in the DataGridDisplay the DataSet in the DataGrid Display the DataSet in the DataGrid 19 Display the DataSet in the DataGrid Display the DataSet in the DataGridDisplay the DataSet in the DataGrid Display the DataSet in the DataGrid Connection Data Adapter Data Source DataSet Web Form Windows Form Presentation Tier Data Tier . 1 Chapter Chapter Chapter Chapter 3 33 3 Windows Database Applications 2 Universal Data Access (UDA) Universal Data Access (UDA)Universal. multiple providers Goal is to access any type of data from any application on any type of computer 3 OLEDB OLEDBOLEDB OLEDB Technology designed to implement the UDA concept Standardized interface. DataSet Object Model The DataSet Object ModelThe DataSet Object Model The DataSet Object Model 13 DataTable Characteristics DataTable CharacteristicsDataTable Characteristics DataTable Characteristics 

Ngày đăng: 13/05/2014, 12:19

TỪ KHÓA LIÊN QUAN

w