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.

Slides:



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

ADO vs ADO.NET ADOADO.NET Client/server coupledDisconnected collection of data from data server Uses RECORDSET object (contains one table) Uses DATASET.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
By Chris Pascucci and FLF
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.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
VB.NET Database Tools ISYS 573. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Objective In this session we will discuss about : What is ADO. NET ?
Some Basic Database Terminology
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
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.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
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.
Developing Web Applications Using Microsoft ® Visual Studio ® 2008.
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.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
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.
CHAPTER EIGHT Accessing Data Processing Databases.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Database, SQL, and ADO.NET- Part 1 Session 11 Mata kuliah: M0874 – Programming II Tahun: 2010.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL ADO.Net Basics Ruwan Wijesinghe Trainer.
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
ADO.NET Data Access. Page  2 SQL  When we interact with the datasource through ADO.NET we use the SQL language to retrieve,modify,update information.
Christopher M. Pascucci.NET Programming: Databases & 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:
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
ADO.NET. ADO.NET is a new, improved, and greatly expanded version of ADO that was developed for the Microsoft.NET initiative It incorporates all of the.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
1 Data Classes- DataView DataGridView Control. Objectives 2  Data Class  DataAdapter  DataReader  DataSet  DataTable  DataView  DataGridView Control.
C# Programming in Depth Prof. Dr. Bertrand Meyer March 2007 – May 2007 Chair of Software Engineering Lecture 10: Database Lisa (Ling) Liu.
Mauricio Featherman, Ph.D. Washington St. University
Module 3: Working with Local Data. Overview Using DataSets Using XML Using SQL Server CE.
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
Active Data Objects Using.Net ADO.Net Farooq Ahmed Amna Umber Summayya Shehzad.
Module 5 Data Classes DataView – DataGridView Control 1.
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.
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
C# 1 CSC 298 ADO.NET. C# 2 ADO.NET  A data access technology that maps very well to the world of the web (disconnected architecture)  data is retrieved.
Integrating Data Lesson 6.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
ASP.NET Programming with C# and SQL Server First Edition
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
VB.NET Using Database.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 10 ADO.
Database Applications
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Presentation transcript:

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 object model *Connect to a database by creating a data adapter *Access a database through a dataset * Preview the data adapter result

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 ADO.NET *Is a model used by Visual Basic.NET applications to communicate with a database for retrieving, accessing, and updating data. * Uses a structured process flow to interact with a database.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Features of ADO.NET *Disconnected data architecture — Applications connect to the database only while retrieving and updating data. *Data cached in datasets — ADO.NET is based on a disconnected data structure. Therefore, the data is retrieved and stored in datasets. *Data transfer in XML format — ADO.NET uses XML for transferring information from a database into a dataset and from the dataset to another component. * Interaction with the database is done through data commands.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 ADO.NET Object Model Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 ADO.NET Object Model DATASET VISUAL BASIC.NET APPLICATION (WINDOWS/ WEB FORM) DATA PROVIDER Accessing retrieved data CONNECTION COMMAND DATA ADAPTER DATA READER Establishes connection with the database Filling dataset with data Transfers data to the dataset and reflects the changes made in the dataset to the database DATABASE Retrieves data in a read-only, forward only mode Executes a command to retrieve data from the database

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 ADO.NET Object Model (Contd.) *Data from a database can be assessed through: 3A dataset  A DataReader object *

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Key Components of the ADO.NET Model *Data Provider 3Is used for connecting to a database, retrieving data, and storing the data. 3Is of two types: OLE DB data provider SQL Server data provider

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Components of a Data Provider *Connection 3Used to establish a connection with a data source 3Some commonly used properties and methods: ConnectionString property Open() method Close() method State property

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Components of a Data Provider (Contd.) *Data adapter 3Creates a dataset and updates the database. 3Handles data transfer between the database and the dataset through its properties and methods. 3Displays the data through the process of table mapping. 3Are of two types: SqlDataAdapter OleDbDataAdapter 3 *

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Components of a Data Provider (Contd.) *Data command 3Is a SQL statement or a stored procedure that is used to retrieve, insert, delete, or modify data from a data source.  Is an object of the OleDbCommand or SQLCommand class.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Components of a Data Provider (Contd.) *Data reader 3Is used to retrieve data from a data source in a read-only and forward-only mode. 3Stores a single row at a time in the memory. 3Commonly used methods: Read() Close() NextResult()  *

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Dataset *Is a disconnected, cached set of records that are retrieved from a database.  Is present as a DataSet class in the System.Data namespace. * Has its own object model.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Dataset Object Model DataRowDataColumn DATASET DataRelationCollection DataRelation DataTableCollection DataTable DataRowCollectionDataColumnCollection ExtendedProperties DataViewPrimaryKey

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Problem Statement 5.D.1 The call center application needs to provide the facility of viewing the customer details for the Sales department.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task List *Identify the data that needs to be displayed. *Identify the method for creating a data adapter. *Identify the type of dataset to be created. *Create a data adapter. *Create a dataset. *Preview the database records.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task 1: Identify the data that needs to be displayed. Result: *As per the given problem statement, the data to be displayed is as follows: 3CustID 3FName 3LName 3Address 3Phone 3

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task 2: Identify the method for creating a data adapter. *There are three methods to create a data adapter: 3Manually 3Through a wizard 3Using the Server Explorer window Result: * In the given problem statement, you will create a data adapter by using Data Adapter Configuration Wizard since it lets you create a data adapter with minimum steps.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task 3: Identify the type of dataset to be created. *Datasets are of two types: 3Typed 3Untyped *Typed dataset  Is derived from the DataSet class and has an associated XML schema, which is created at the time of the creation of the dataset. 3Can be customized after creation. 3 Supports Intellisense and auto ‑ completion for the elements of the syntax while writing code.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task 3: Identify the type of dataset to be created. (Contd.) *Untyped dataset 3Does not have any associated XML schema, therefore, the structure of an untyped dataset is not known at the compile time. 3Represents tables and columns as collections. 3Does not support Intellisense and auto ‑ completion for the elements of the syntax. Result: * Since the structure of the data is known at compile time, you will create a typed dataset for the given problem statement.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Task 4: Create a data adapter. Task 5: Create a dataset. Task 6: Preview the database records.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Problem Statement 5.P.1 An application needs to be created that allows the Diaz Telecommunications Sales Manager to preview the customer order details from the database. In addition, for each order, percentage of the cost of a product given as advance needs to be previewed.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Summary In this lesson, you learned that: *ADO.NET is a data access programming model for accessing the data stored in a database from a.NET application. *ADO.NET has the following features: 3A disconnected data architecture 3Data cached in datasets 3The use of XML format for data transfer 3 Database operations done through data commands

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Summary (Contd.) *ADO.NET consists of the following components: 3Data Provider — Used for connecting to a database, retrieving data, storing the data in a dataset, and updating the database. 3Data Adapter — A data adapter is integral to the working of the ADO.NET model since data transfer to and from the database is done through a data adapter. 3Dataset — A dataset is a disconnected cached set of records that are retrieved from the database. * A data adapter communicates with a database through data commands. These data commands use parameters for execution.

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Summary (Contd.) *After a dataset has been created, a data adapter uses the process of table mapping to map the columns in the database table with the dataset columns. *A data adapter can be created by using any of the following methods: 3Manually 3Through a wizard 3 By using Server Explorer

Working with ADO.NET Working with ADO.NET/Lesson 5/Slide ‹#› of 30 Summary (Contd.) *Datasets are of two types: 3Typed datasets – A typed dataset is derived from the DataSet class and has an associated schema. 3Untyped datasets – An untyped dataset does not have any associated XML schema. The tables and columns in an untyped dataset are represented as collections. *