Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.

Slides:



Advertisements
Similar presentations
Database Connections with ASP.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.
 ADO.NET Overview  ADO.NET Classes. ADO.NET Overview Looking Back  ODBC (Open Database Connectivity)  Interoperability to a wide range of database.
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.
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.
ADO. NET. What is “ADO.Net”? ADO.Net is a new object model for dealing with databases in.Net. Although some of the concepts are similar to the classical.
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Programming in ADO.NET: Data-Centric Applications and ADO.NET Original copyright by Microsoft, 2002, with minor modifications by Dan Eaves, 2005.
Objective In this session we will discuss about : What is ADO. NET ?
Overview of ADO.NET Chapter 1 ADO.NET 4.0 Development.
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
ADO.NET – part II August 2004 [ Marmagna Desai]. CONTENTS ADO vs ADO.NET ADO.NET – Managed providers Connecting to Database SqlConnection Selecting Database.
ODBC, OLE DB, and ADO Introduction Dr. Ron Eaglin.
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 ADO.NET with the.NET Framework Scalable Development, Inc. Building systems today that perform tomorrow.
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.
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.
.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.
Chapter 3 Introduction to ADO.NET 3.1 The ADO and ADO.NET ActiveX Data Object (ADO) is developed based on Object Linking and Embedding (OLE) and Component.
Moving from Microsoft ® ADO 2.X To ADO.NET Jackie Goldstein Renaissance Computer Systems Ltd. MSDN Regional Director, Israel Prerequisites.
 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.
Database, SQL, and ADO.NET- Part 1 Session 11 Mata kuliah: M0874 – Programming II Tahun: 2010.
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
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:
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
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.
Why ADO.NET Not your father’s Data Access.
HNDIT Rapid Application Development
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
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
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
Active Data Objects Using.Net ADO.Net Farooq Ahmed Amna Umber Summayya Shehzad.
Module 5 Data Classes DataView – DataGridView Control 1.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
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.
ASP.NET Programming with C# and SQL Server First Edition
Data Access with ADO.NET
Introduction to ADO.NET
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
Lecture 6 VB.Net SQL Server.
ADO.NET Accessing Databases in VS.NET
Chapter 10 ADO.
Introduction to Database Programming through ADO. NET
Presentation transcript:

Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET

ADO.NET Overview Looking Back  ADO (ActiveX Data Objects) Simple component-based, object-oriented interface Provides a programming model to OLE DB accessible outside of C++

ADO.NET Overview What Is ADO.NET?  ADO.NET is a collection of classes, interfaces, structures, and enumerated types that manage data access from relational data stores within the.NET Framework These collections are organized into namespaces: System.Data, System.Data.OleDb, System.Data.SqlClient, etc.  ADO.NET is an evolution from ADO.The next generation of ADO

Managed Providers  It performs operation of communicating with the database  Similar to ODBC driver or OLEDB provider  ADO.NET currently provides two distinct managed providers The SQL Server managed provider is used with SQL server OLEDB managed provider is used to communicate with any OLEDB compliant database like Access or Oracle.

Data access namespaces  System.Data  System.Data.OleDb  System.Data.SQLClient  System.Data.SQLTypes  System.Data.XML

Main objects of ADO.NET  OleDbConnection / SQLConnection  OleDbCommand / SQLCommand  OleDbDataReader / SQLDataReader  OleDbDataAdapter / SQLDataAdapter  OleDbParameter / SQLParameter  DataSet  DataTable  DataView  DataRow  DataColumn

SQL Managed Provider SQL Server Database ADO.NET Overview Managed Providers ADO.NET Managed Provider ADO Managed Provider OLE DB Provider Database Your Application

ADO.NET Overview Data Access Styles  Connected: Forward-only, read-only Application issues query then reads back results and processes them “Firehose” cursor DataReader object  Disconnected Application issues query then retrieves and stores results for processing Minimizes time connected to database DataSet object

ADO.NET objects  These objects are divided into two groups  To manage data (DataSet,DataTable,DataRow,DataRelation) To connect data(Connections,DataReader)

What is DataSet,DataAdapter  Dataset is an in-memory disconnected representation of data from actual database  Since dataset is totally disconnected from the database there must be some means of communication between the dataset and the database  DataAdapter is used for that purpose.

Functions of DataAdapter  Populate the dataset by fetching data from database  Updating changes made to the dataset back to the database Changes made to the dataset are not written to the database unless explicitly updated via DataAdapter.

DataSet  The DataSet object stores the disconnected data from a database and allows you to manipulate it as a single object  The DataSet Objects inturn has two other objects DataTable,DataRelation

ADO.NET Classes DataSet DataSet DataTable DataRelation DataRow DataColumn

DataTable  It consists collection of DataRow and DataColumn  DataRow  Represents a single row of information  Individual values can be accessed using the field names  DataColumn  Does not hold any data instead information about the column such as Datatype,default value

DataRelation  Each DataRelation Object represents a single parent/Child relationship between two different datasets  DataView-Used to bind data in the DataTable object  Displays data or it can also filter and sort data

ADO.NET Classes DataRelation  Relates two DataTables via DataColumns  DataType value of both DataColumns must be identical  Updates can be cascaded to child DataTables  Modifications that invalidate the relation are disallowed

The data Source Interaction Web page Connection object commandDataReader Data Store

ADO.NET Classes IDbConnection Interface  Creates a unique session with a data source  Implemented by SqlDbConnection and OleDbConnection  Functionality Open, close connections Begin transactions IDbTransaction provide Commit and Rollback methods  Used in conjunction with IDbCommand and IDataAdapter objects

ADO.NET Classes IDbCommand Interface  Represents a statement to be sent to a data source Usually, but not necessarily SQL  Implemented by OleDbCommand and SqlCommand  Functionality Define statement to execute Execute statement Pass and retrieve parameters Create a prepared (compiled) version of command

 ExecuteReader returns rows  ExecuteNonQuery doesn’t  ExecuteScalar returns single value

ADO.NET Classes System.Data.OleDb Namespace  Managed provider for use with OLEDB providers SQLOLEDB (SQL Server) – use System.Data.SQL MSDAORA (Oracle) JOLT (Jet) OLEDB for ODBC providers  OleDbConnection, OleDbCommand and OleDbDataReader classes  Classes for error handling  Classes for connection pooling

ADO.NET Classes DataSet  A collection of tables  Has no knowledge of the source of the data  Keeps track of all relationships among tables  Rich programming model (has objects for tables, columns, relationships, and so on)  Remembers original and current state of data  Can dynamically modify data and metadata  Native serialization format is XML  Located in System.Data

ADO.NET Classes System.Data.SqlClient Namespace  Managed provider native to SQL Server  Built on TDS (Tabular Data Stream) for high performance in SQL Server  SqlConnection, SqlCommand and SqlDataReader classes  Classes for Error handling Connection pooling (implicitly enabled by default )  System.Data.SqlTypes provides classes for native SQL Server data types

ADO.NET Classes IDataAdapter Interface  Populates or sends updates to a DataSet  Implemented by OleDbDataAdapter and SqlDataAdapter  Not connection based  Represents an asynchronous approach  A superset of a command object  Contains four default command objects for Select, Insert, Update, and Delete

Conclusion  Database Theory and History  Relational Database Concepts and Terminology  ADO.NET Overview  ADO.NET Classes

Appendix ADO vs. ADO.NET  ADO is a slower automation layer over OLE DB for use in Visual Basic, etc.  ADO.NET provides direct, fast access to data from any language  ADO.NET essentially has merged OLE DB and ADO into a single layer

Appendix ADO vs. ADO.NET FeatureADOADO.NET Memory-resident Data Representation Uses RecordSet, which can contain one table Uses DataSet, which can contain one or more tables represented by DataTables Relationship Between Multiple Tables Require the JOIN querySupports the DataRelation object Data VisitationScans RecordSet rows sequentially Uses a navigation paradigm for non- sequential access Disconnected AccessProvided by RecordSet but typically supports connected access Communicates with standardized calls to the DataAdapter

Appendix ADO vs. ADO.NET FeatureADOADO.NET ProgrammabilityUses Connection object to transmit commands Uses strongly typed programming characteristics of XML Sharing Disconnected Data Between Tiers or Components Uses COM marshalling to transmit disconnected Recordset Transmits a DataSet with an XML file Transmitting Data Through Firewalls Problematic because firewalls are typically configured to prevent system-level requests Supported, DataSet object use XML, which can pass through firewalls ScalabilityDatabase locks and active database connections for long durations Disconnected access to database data without retaining database locks