Module 5 Data Classes DataView – DataGridView Control 1.

Slides:



Advertisements
Similar presentations
17. Data Access ADO.Net Architecture New Features of ADO.NET
Advertisements

Disconnected Data Applications: using Datasets, XML and Transactions.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
VB.NET Database Access ISYS546. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Introduction to Data Adapter. A Simplified View of ADO.Net Objects Ado.Net Data Provider Connection Adapter Command Reader Dataset Data Consumer WinForm.
1 ADO.NET. 2.NET Framework Data Namespaces System.Data –Base set of classes and interfaces for ADO.NET System.Data.Common –Classes shared by the.NET Data.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS546.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Objective In this session we will discuss about : What is ADO. NET ?
Introduction to ADO.Net and Visual Studio Database Tools
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
ADO.NET – part II August 2004 [ Marmagna Desai]. CONTENTS ADO vs ADO.NET ADO.NET – Managed providers Connecting to Database SqlConnection Selecting Database.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Chapter 81 Building Data-Driven Web Applications Introduction to ASP.NET By Kathleen Kalata.
ADO.NET Tools and Wizards. Slide 2 Data Sources Window (Introduction) Use the Data Sources window to Establish a connection Create bound control instances.
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
1 ASP.NET ASP.NET Rina Zviel-Girshin Lecture 4. 2 Overview Data Binding Data Providers Data Connection Data Manipulations.
A Simple Introduction. What is ADO.net? First the word ADO stands for ActiveX Data Objects And it is an integral part of.Net Framework of Microsoft hence.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
.NET Data Access and Manipulation ADO.NET. Overview What is ADO.NET? Disconnected vs. connected data access models ADO.NET Architecture ADO.NET Core Objects.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
ASP.NET Rina Zviel-Girshin Lecture 5
Module 9: Accessing Relational Data Using Microsoft Visual Studio.NET.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
Module 7: Accessing Data by Using ADO.NET
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Introduction to ADO.NET ADO.NET - Lesson 01  Training time: 10 minutes  Author:
Module 4: Building DataSets. Overview Working in a Disconnected Environment Building DataSets and DataTables Binding and Saving a DataSet Defining Data.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
An Introduction to ADO.Net Marmagna Desai.NET Seminar, Fall-2003.
 It is the primary data access model for.Net applications  Next version of ADO  Can be divided into two parts ◦ Providers ◦ DataSets  Resides in System.Data.
1 Data Classes- DataView DataGridView Control. Objectives 2  Data Class  DataAdapter  DataReader  DataSet  DataTable  DataView  DataGridView Control.
Why ADO.NET Not your father’s Data Access.
Mauricio Featherman, Ph.D. Washington St. University
Making the Most of WinForms 2.0 Data Binding Rajiv Sodhi Microsoft India.
Module 3: Working with Local Data. Overview Using DataSets Using XML Using SQL Server CE.
1 11/15/05CS360 Windows Programming ADO.NET Continued.
HNDIT Rapid Application Development
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
Module 4 Introduction ADO.NET.
ADO.NET in VB.NET 2005 ITE 370 4/26/2017.
C# .NET Software Development
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
Querying Information in a Database. CONTENTS Relational Database Systems Creating Database with SQL Server Reading Data with LINQ Requirements to Get.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
Integrating Data Lesson 6.
Introduction to ADO.NET
Introduction to Database Processing with ADO.NET
Database, SQL and ADO.NET
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
Active Data Objects Binding ASP.NET Controls to Data
VB.NET Using Database.
Tonga Institute of Higher Education
Bài 5: ADO.NET 5.1. Khái niệm 5.2. Các lớp và không gian tên cơ bản của ADO.NET 5.3. Thao tác với dữ liệu kết nối – Connected 5.4. Thao tác với dữ liệu.
Chapter 10 ADO.
Active Data Objects Binding ASP.NET Controls to Data
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Presentation transcript:

Module 5 Data Classes DataView – DataGridView Control 1

Objectives Data Classes:  DataAdapter  DataReader  DataSet  DataTable DataView DataGridView Control 2

DataAdapter Consists of a set of SQL commands and a DB Connection:  These are used to fill the DataSet & update the data source ADO.NET implements various data adapters inherited from the DbDataAdapter class:  SqlDataAdapter  OleDbDataAdapter 3 PropertiesAcceptChangesDuringFill, AcceptChangesDuringUpdate, FillLoadOption, TableMappings MethodsFill, Update, GetFillParameters EventFillError

SqlDataAdapter Serves as a link betweena DataSet and the SQL Server Database for retrieving and saving data. 4 PropertySelectCommand, InsertCommand,UpdateCommand DeleteCommand EventRowUpdated, RowUpdating

OleDbDataAdapter  Used to connect to multiple database such as : SQLServer, Access, Oracle  Exists in the namespace : System.Data.OleDb  Have the same properties and events as SqlDataAdapter 5

SqlDataReader Used to read data from SQL Server in a sequential manner:  Retrieves a forward-only and read-only stream of data  Is used in the connected architecture of ADO.NET Steps for retrieving data:  Connect to SQL Server by SqlConnection  Invoke ExecuteReader() method of SqlCommand object  Read the records by Read() method 6 Property FieldCount, HasRows, IsClosed,RecordsAffected Method Read, GetByte, GetChar, GetInt32, GetSqlString, GetString, GetValue, GetName, Close

DataSet Is a representation of database objects in cached memory. Includes relational tables and constraints. Interacts with data source indirectly. Features:  Working with disconnected data  Working with Hierarchical data  Caching changes  Supporting XML  Implementing Uniform functionality 7 PropertyDataSetName, Relations, Tables, Locale MethodAcceptChanges, Clear, Merge, GetXml, ReadXml, WriteXML, RejectChanges,

More on DataSets … Types of DataSet :  TypeDataSet : Have a schema xsd  UntypeDataSet : Create by a code : DataSet A = new DataSet() Fetching XML data using DataSets:  ReadXML(string path) : read XML file to DataSet  WriteXML(string path) : save the content DataSet to a XML file Navigate Record :  Using the index of the collection (table)  Using BindingSource class and methods such as : MoveFirst, MoveLast, MoveNext, MovePrevious 8

DataTable Represent a table in DataSet Have a constraint objects that ensure data integrity. 9 PropertyTableName, Columns, Rows, DataSet, ParentRelations, ChildRelations MethodClear,Load, AcceptChanges, NewRow, ReadXml, WriteXml, Select EventColumnChanged, RowChanged, RowDeleted, TableNewRow

DataTableCollection is a collection of the DataTables in DataSet 10 PropertyCount, Item MethodClear,Add, Remove EventCollectionChanged

DataRelation Maintains referential integrity by enforcing : Foreign-key constraint Unique constraint Cascade update and delete operation Use to relate two columns that exist in two tables. 11

DataColumn class Used for creating a schema for a particular column Can be added to a DataColumnCollection Properties:  Caption,ColumnName,DataType, DefaultValue, MaxLength, Table, Unique 12

DataRow Represent a row in a DataTable 13 PropertyItem, RowError, RowState, Table MethodAcceptChanges, Delete, SetAdded

DataTableReader Is used to retrieve data from one or more DataTables in forward-only and read-only mode. Is a new class introduced in.NET Framework 2.0. Allows to iterate rows in the cache memory DataTableReader dtr = dataTable.CreateDataReader() 14 PropertyGetData, GetDataTypeName, GetName, GetString, GetValue, FieldCount, IsClosed, Item MethodClose, NextResult, Read

Demo 15

Summary Data Classes:  DataAdapter  DataReader  DataSet  DataTable 16

DataView Used to sort, filter, search, modify and navigate through the records Constructor of this class is a DataTable 17 PropertyAllowDelete,AllowEdit, AllowNew, Count, Item, RowFilter, RowStateFilter, Sort, Table MethodAddnew, Close, Delete, Dispose, Find, Open, ToTable EventInitialized, ListChanged

DataViewManager Used to specify the settings for each table in the dataset. Is useful for binding a DataSet to more than one table and display them in the DataView. Ensures that accurate and required data is retrieved from each table. 18 PropertyDataSet, DataViewSettings MethodCreateDataView EventListChanged

DataGrid control Display data in a tabular format Populated by the table present in dataSet ( binding) Insert, delete, update  DataSet 19 PropertyCurrentCell, CurrentRowIndex, DataBindings, DataMember, DataSource, Item MethodBeginEdit, Collapse, IsExpanded, IsSelected, NavigateBack, NavigateTo, Select, Unselect

DataGridView control Provides different column styles such as text,check … Supports multiple data sources with different databases. Allows to use the cache memory  enhances performance Uses the BindingSource to simplify the process of data binding. 20 PropertyAutoGenerateColumns, Columns, DataMember, DataSource, Item, Rows, SelectedColumns, SelectedRows MethodClearSelection, CommitEdit, DisplayedColumnCount, DisplayedRowCount, GetCellCount, SelectAll,Sort EventAutoGenerateColumnsChanged, CellClick, CellValueChanged, DataMemberChanged, DataSourceChanged, RowValidated, RowValidating

Example 21

DataGridView & DataGrid control 22

Summary 23