Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)

Slides:



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

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
ADO.NET: Working in Disconnected Environment Sergey Baidachni MCT, MCSD, MCDBA.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
Introduction to Database Processing with ADO.NET.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
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 with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
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.
FEN Data connection DataReader DataSet Bonus info: Concurrency and Database Transactions Embedded SQL.
CIS 451: Using ASP.NET Objects with SQL Dr. Ralph D. Westfall February, 2009.
Web Services Week 8 Aims: –Using web services as front ends to databases Objectives: –Review of relational databases –Connecting to and querying databases.
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.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
 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.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with Disconnected Data The DataSet and SqlDataAdapter ADO.NET - Lesson.
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.
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.
ADO.NET Part 2. Slide 2 Overview Slide 3 Introduction to the DataGridView Control It’s a two-dimensional grid containing rows and columns Its use in.
Object Oriented Software Development 10. Persistent Storage.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Module 3: Performing Connected Database Operations.
 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 CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
HNDIT Rapid Application Development
Android - SQLite Database 12/10/2015. Introduction SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with.
Module 4 Introduction ADO.NET.
Active Data Objects Using.Net ADO.Net Farooq Ahmed Amna Umber Summayya Shehzad.
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.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
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.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
 ADO.NET is an object-oriented set of libraries that allows you to interact with data sources  Commonly, the data source is a database, but it could.
Web Database Programming Using PHP
Database: JDBC Overview
ASP.NET Programming with C# and SQL Server First Edition
Introduction to ADO.NET
Accessing Databases using Ado.net
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
© 2016, Mike Murach & Associates, Inc.
Programming the Web Using ASP.Net
Lecture 6 VB.Net SQL Server.
Web Database Programming Using PHP
Database JDBC Overview CS Programming Languages for Web Applications
Active Data Objects Binding ASP.NET Controls to Data
By Chris Pascucci and FLF
VB.NET Using Database.
Tonga Institute of Higher Education
Developing a Model-View-Controller Component for Joomla Part 3
Database Objects 1/12/2019 See scm-intranet.
Chapter 10 ADO.
PROG Advanced Web Apps 4/13/2019 Programming Data Pages Wendi Jollymore, ACES.
.NET Framework Data Providers
Updating Databases With Open SQL
Active Data Objects Binding ASP.NET Controls to Data
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Updating Databases With Open SQL
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)

Objectives Understand database processing using ADO.NET Perform specialized database processing tasks Work with database data programmatically using either DataReaders (connected mode) DataSets (disconnected mode) We discuss DataReaders here

DataReader The DataReader is a component used for read-only and forward-only connection to a database. Results are returned as a query executes and stored in the network buffer on the client until you request them using the Read method of the DataReader. Using the DataReader can increase application performance both by retrieving data as soon as it is available, and (by default) storing only one row at a time in memory, reducing system overhead. It is used to execute a query via a connection to a database and iterate through the data returned. The abstraction provided here is that of a connected data architecture.

DataReader

The Processing Sequence Holds for both connected and disconnected architectures Establish a connection to your data source using a Connection Object These objects are simple to construct Create an SQL statement (a string) and wrap it in a Command object These strings are harder to build – more detailed Execute the Command object within the context of the Connected DB – there are methods for this Process (retrieve or store) results of command if there are any Use a DataReader object to scan through records Close all objects you opened to process data

The Primary Objects The Connection Object – Directs communication between your program and Data Source. Handles location and connection parameters for the data source. The Command Object – Takes an SQL statement you provide (as a string) and prepares it for transport through the Connect-ion Object and subsequent processing in the specified DBMS. The DataReader Object – Provides a simple and efficient way to retrieve results from an SQL query. It is used by other objects in ADO.NET to retrieve and redirect data within your program. You can use this reader directly to process the result of a SELECT or other retrieval action.

DataReader Example

Example: Insert a Record

Example: Delete a Record

Example: Update a Record

DataReaders – main use DataReaders Simple and efficient way to retrieve results from a query Can use directly to process results of a SELECT or to provide direct access INSERTs, DELETEs, and UPDATEs A query gives you access to one row of table information at a time Your connection must be open before a command is executed and should be closed when you are done

Using DataReaders

The OleDbCommand Class The OleDbCommand class stores SQL statements The Connection property stores a reference to an OleDbConnection The CommandText property stores an SQL statement The CommandType property should be set to Text

Example 1 – Insert (plus a simple select) (Uses Insert and DataReader commands to effect data transmission)

Example 2 – Using Max Transaction ID Commit list of transactions to a DB – quote corrections needed

Example 3 – Delete (remove) a record (quote corrections needed)

Example 4 – Update a Record-(quote corrections needed)