The Problems HTTP is disconnected So many database vendors Create a simple consistent versatile interface on the data Look at ADO.NET classes OleDb SQL.

Slides:



Advertisements
Similar presentations
By Chris Pascucci and FLF
Advertisements

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.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
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.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Objective In this session we will discuss about : What is ADO. NET ?
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
Interacting With Data Week 8 Connecting to the database Creating recordsets Interacting with the database.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
Functions of a Database Management System
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.
Part 1. Persistent Data Web applications remember your setting by means of a database linked to the site.
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)
Learningcomputer.com SQL Server 2008 Configuration Manager.
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.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
Connecting to Oracle using Java November 4, 2009 David Goldschmidt, Ph.D. David Goldschmidt, Ph.D.
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.
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.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
ASP.NET Rina Zviel-Girshin Lecture 5
Module 9: Accessing Relational Data Using Microsoft Visual Studio.NET.
Module 7: Accessing Data by Using ADO.NET
A Brief Documentation.  Provides basic information about connection, server, and client.
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:
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)
Database Farming For Improved Performance Presented By: Russell Yong Supervisor: Prof Wentworth.
JDS – VB.NET Skill Session Fall 2004 Presented by YUHAO LIN.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
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 Architecture MIS3502: Application Integration and Evaluation David Schuff Adapted from material by Arnold Kurtz, David.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Module 4 Introduction ADO.NET.
1 Database Programming with ADO.NET Kashef Mughal.
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 Road Map The Scope of the Problem A range of potential problems Lost Updates User A reads a record User B reads the same record User A makes changes.
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.
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
PHP / MySQL Introduction
Chapter 3: Windows7 Part 4.
VB.NET Using Database.
DUCKS – Distributed User-mode Chirp-Knowledgeable Server
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Fundamentals of Databases
Chapter 10 ADO.
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

The Problems HTTP is disconnected So many database vendors Create a simple consistent versatile interface on the data Look at ADO.NET classes OleDb SQL server optimised

ADO.NET Classes System.Data.OleDb.OleDbConnection The connection object is used to create a connection between our code and the database. System.Data.OleDb.OleDbCommand Used to store a command to be applied to the database. May be either raw SQL or a stored procedure. System.Data.OleDb.OleDbParameter Used to model parameters passed to the stored procedures / queries. System.Data.OleDb.OleDbDataAdapter Used to fill a data table with the results of a command.

ADO.NET Classes Continued System.Data.DataTable Used to model data obtained from the database. Data Readers We are also going to take a look at data readers even though they are not used on the module.

Connected v Disconnected Data The need for locking… User A opens a record User B opens the same record and makes changes User B saves the changes on the record User A makes their changes to the record User A now saves their changes and overwrites the changes made by User B Relatively easy to lock records on a local area network

Disconnected Data When a client application access a record it communicates with the server via the HTTP request. The server locates and processes the data returning it to the client at which point the connection is lost. User A opens a record on the browser, the server locks the record to stop User B accessing it User B tries to access the record and is presented with a message stating that the record is locked User A is in the middle of editing the record and his browser crashes thus not telling the server he is done with the record User B sits there waiting and waiting for the record to come free!

Add a Time – Out? User A opens the record and goes and makes a cup of tea The lock times out User B opens the record What does User A do with their data when the save the changes? I am not planning on exploring solutions to these problems, simply to bring your attention to them.

OleDb v SQL Optimised Classes OleDB is a technology devised by Microsoft for connecting to a wide range of database management systems (DBMS), e.g. Access, Oracle MySQL. SQL optimised classes perform in exactly the same way as the OleDB classes but fine tuned to work with SQL server.

Usage OleDb OleDbConnection connectionToDB = new OleDbConnection (); SQL SqlConnection connectionToDB = new SqlConnection(); The classes also have different namespace... using System.Data.SqlClient; and using System.Data.OleDb;

The Execute Function

The Connection Object connectionToDB = new OleDbConnection(connectionString);

DSN / DSN(less) Connections DSN = Data Source Name The database may be file on the disk (the way that we have been connecting to the database in this module!) (DSN(less)) Or the database may be running on a server with an IP address on a specific port number (remember TCP/IP allows a program on one computer to talk to another!) (DSN)

Data Providers DBMS specific driver

Connection Strings Contains DBMS specific configuration data Specifies the data provider //open the database connectionToDB.Open();

The Command Object Applies a “Command” to the data Initialise with stored procedure name and connection //initialise the command builder for this connection OleDbCommand dataCommand = new OleDbCommand(SProcName, connectionToDB); Add parameters //loop through each parameter for (int Counter = 0; Counter < SQLParams.Count; Counter += 1) { //add it to the command object dataCommand.Parameters.Add(SQLParams[Counter]); } Set the Command Type //set the command type as stored procedure dataCommand.CommandType = CommandType.StoredProcedure;

So far…

The Mincing Machine

Data Adapter Initialisation //set the select command property for the data adapter dataChannel.SelectCommand = dataCommand; Filling the Data Table //fill the data adapter dataChannel.Fill(queryResults);

Data Tables Select * from tblAddress To reference “Nottingham” in our code we would do the following... AnAddress.Town = queryResults.Rows[3]["Town"].ToString();

Data Readers Read-only, forward-only stream of data Faster and more light weight than data tables Lock the data so may have problems with multiple connections One way flow of data

Example