intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Data Classes - DataView DataGridView Control

Chia sẻ: Lavie Lavie | Ngày: | Loại File: PPT | Số trang:32

76
lượt xem
7
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Data Classes - DataView DataGridView Control's Objectives is Data Class (DataAdapter, DataReader, DataSet, DataTable); DataView; DataGridView Control. It includes DataAdapter Properties, SqlDataAdapter; OleDbDataAdapter; SqlDataReader class; DataSet;...

Chủ đề:
Lưu

Nội dung Text: Data Classes - DataView DataGridView Control

  1. Data Classes- DataView DataGridView Control 1
  2. Objectives  Data Class  DataAdapter  DataReader  DataSet  DataTable  DataView  DataGridView Control  Summary 2
  3. DataAdapter Properties 3
  4. Demo SqlDataAdapter is the best way to load data from server to DataSet 4
  5. SqlDataAdapter : properties - Events DeleteCommand InsertCommand SelectCommand UpdateCommand RowUpdate RowUpdating SqlDataAdapter dataAdapt = new SqlDataAdapter(); SqlCommand cmd = new SqlCommand(“Select * from authors” , con); dataAdapt.SelectCommand = cmd ; DataSet ds = new DataSet(); dataAdapt.Fill(ds); 5
  6. OleDbDataAdapter  Used to connect to multiple databses such as : SQLServer , Access , Oracle  Exists in the namespace : System.Data.OleDb  Have the same properties and events as SqlDataAdapter 6
  7. SqlDataReader class • Used to read data from SQL Server in a sequential manner and have some properties : • Forward-only - Read Only • Get it by call the FieldCount ExecuteReader() method of SqlCommand object • Read data by Read() method HasRow IsClosed Item RecordsAffe cted 7
  8. SqlDataReader : Method 8
  9. DataSet • A representation of a database in cached-memory • Included datatable and relation and contrains Ex : DataSet ds = new DataSet() 9
  10. Method – Kind of DataSet TypeDataSet : -Have a schema : .xsd UntypeDataSet : -Create by a code : DataSet A = new DataSet() Navigate Record : Using Binding source class and use some methods of this class as : - MoveFirst - MoveLast - MoveNext - MovePrevious 10
  11. DataSet and XML DataSet can fetch data from a XML file • ReadXML(string path) : read XML file to DataSet • WriteXML(string path) : save the content DataSet to a XML file 11
  12. DataTable class • Represent a table in DataSet • Have a constraint objects that ensure data integrity Properties 12
  13. Method 13
  14. DataTable: Event 14
  15. DataTableCollection • The DataTableCollection class is a collection of the tables in DataSet • Collection of the DataTable class 15
  16. DataRelation • Maintains referential integrity by enforcing foreign-key constraint • Unique constraint • Cascade update and delete operation • Use to relate two DataColumn Object that exits in two DataTable 16
  17. DataColumn class • Used for creating a schema for a particular column • You can add a column to a DataColumnCollection 17
  18. DataRow class Represent a row in a DataTable 18
  19. DataTableReader 19
  20. DataTableReader DataTableReader dtr = dataTable.CreateDataReader() 20
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
3=>0