Top Banner
Session 8 Slide 1 of 13 06/15/22 Data Classes
19
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Session 8 Bai 8 ve winform

Session 8

Slide 1 of 13

04/11/23

Data Classes

Page 2: Session 8 Bai 8 ve winform

Slide 2 of 26

04/11/23

Module Introduction

Page 3: Session 8 Bai 8 ve winform

Slide 3 of 26

04/11/23

"DataAdapter" Class DataAdapter class forms the base class for all data adapters. ADO.NET implements various data adapters. These data adapters are inherited from the DbDataAdapter class.

"SqlDataAdapter" Class The SqlDataAdapter serves as a link between a DataSet and the SQL Server database for retrieving and saving data.

The SqlDataAdapter class exists in the System.Data.SqlClient namespace.

Page 4: Session 8 Bai 8 ve winform

Slide 4 of 26

04/11/23

Page 5: Session 8 Bai 8 ve winform

Slide 5 of 26

04/11/23

"SqlDataReader" Class The SqlDataReader class is used to read data from a SQL Server database. It exists in the System.Data.SqlClient namespace.For retrieving data from the database:+ First connect to SQL Server database using SqlConnection.+ Call the ExecuteReader() method of the SqlCommand class to retrieve records from the database. + Read the records by executing the Read() method.

Page 6: Session 8 Bai 8 ve winform

Slide 6 of 26

04/11/23

Page 7: Session 8 Bai 8 ve winform

Slide 7 of 26

04/11/23DataSet

Page 8: Session 8 Bai 8 ve winform

Slide 8 of 26

04/11/23

Page 9: Session 8 Bai 8 ve winform

Slide 9 of 26

04/11/23

Typed Datasets DataSet object can either be typed or untyped. A typed DataSet is a class derived from the DataSet class.

Page 10: Session 8 Bai 8 ve winform

Slide 10 of 26

04/11/23

UnTyped DatasetsAn untyped dataset does not have a built-in schema

Page 11: Session 8 Bai 8 ve winform

Slide 11 of 26

04/11/23

Fetching XML Data Using DatasetsDataSet objects can fetch data from an XML file. + ReadXml() method contains the path of the XML file. This method reads the XML data including the schema of the XML file.+ Can make changes to the XML data in the DataSet and updatethe changes to the XML source file using the WriteXml() method.

Page 12: Session 8 Bai 8 ve winform

Slide 12 of 26

04/11/23

Navigating Records

Page 13: Session 8 Bai 8 ve winform

Slide 13 of 26

04/11/23

"DataTable" Class A DataTable class represents a table in the DataSet. It is used to store data from a data source. It contains a set of rows and columns to organize data in a tabular format.

Page 14: Session 8 Bai 8 ve winform

Slide 14 of 26

04/11/23

"DataTableCollection" Class The DataTableCollection class is a collection of tables for a DataSet. It enables you to access the collection of DataTable objects and navigate through the tables in the DataSet.

Page 15: Session 8 Bai 8 ve winform

Slide 15 of 26

04/11/23

Page 16: Session 8 Bai 8 ve winform

Slide 16 of 26

04/11/23

Setting Relation between Tables

Page 17: Session 8 Bai 8 ve winform

Slide 17 of 26

04/11/23

"DataColumn" ClassThe DataColumn class represents a column in a DataTable.

Page 18: Session 8 Bai 8 ve winform

Slide 18 of 26

04/11/23

"DataRow" ClassThe DataRow class represents a row in a DataTable.

Page 19: Session 8 Bai 8 ve winform

Slide 19 of 26

04/11/23

"DataTableReader" Class