ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.

Slides:



Advertisements
Similar presentations
Basic SQL Introduction Presented by: Madhuri Bhogadi.
Advertisements

Accounting System Design
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Introduction to Structured Query Language (SQL)
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Introduction to Structured Query Language (SQL)
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSC 2720 Building Web Applications Database and SQL.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Chapter 10 - VB.Net by Schneider1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Relational Databases and SQL.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
ASP.NET Programming with C# and SQL Server First Edition
LOGO 1 Lab_02: Basic SQL. 2 Outline  Database Tables  SQL Statements  Semicolon after SQL Statements?  SQL DML and DDL  SQL SELECT Statement  SQL.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Database Technical Session By: Prof. Adarsh Patel.
2440: 141 Web Site Administration Database Management Using SQL Professor: Enoch E. Damson.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
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.
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.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
File Processing Concepts – Field – combination of 1 or more characters that is the smallest unit of data to be accessed – Record – group of related fields.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
IST 220 Introduction to Databases Course Wrap-up.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
Chapter 9 Constraints. Chapter Objectives  Explain the purpose of constraints in a table  Distinguish among PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK,
Oracle 11g: SQL Chapter 4 Constraints.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Zhangxi Lin Texas Tech University ISQS 6347, Data & Text Mining 1 ISQS 6339 Data Management and Business Intelligence Database Review.
Visual Programing SQL Overview Section 1.
Mauricio Featherman, Ph.D. Washington St. University
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
1 DBS201: More on SQL Lecture 3. 2 Agenda How to use SQL to update table definitions How to update data in a table How to join tables together.
Week 8-9 SQL-1. SQL Components: DDL, DCL, & DML SQL is a very large and powerful language, but every type of SQL statement falls within one of three main.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Chapter 3: Relational Databases
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
1 SQL SERVER 2005 Express CE-105 SPRING 2007 Engr. Faisal ur Rehman.
Web Systems & Technologies
Chapter 5 Introduction to SQL.
© 2016, Mike Murach & Associates, Inc.
Introduction to Structured Query Language(SQL)
Active Data Objects Binding ASP.NET Controls to Data
VB.NET Using Database.
مقدمة في قواعد البيانات
SQL-1 Week 8-9.
The University of Akron College of Applied Science & Technology Dept
DATABASE Purpose of database
Active Data Objects Binding ASP.NET Controls to Data
Presentation transcript:

ASP.NET Database Connectivity I

2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity

3 © UW Business School, University of Washington 2004 What is a Database? Relational database – RDBMS Relational database is nothing but tables –Inter-related tables

4 © UW Business School, University of Washington 2004 Table Columns, attributes, fields, variables Rows, records, tuples Unique identify – primary key Rule: no order for attributed and records!

5 © UW Business School, University of Washington 2004 Properties of Tables No order for rows and columns No duplicate rows No duplicate columns Relational integrity –Must have primary key filled by meaningful values (Entity Integrity) –Must have reference foreign keys to link to something that is already there at referential table (Referential Integrity)

6 © UW Business School, University of Washington 2004 Primary Keys Primary Key –Uniqueness –Minimality – if key is composite, then no component of it can be eliminated without destroying the uniqueness property –Not allowed to accept nulls

7 © UW Business School, University of Washington 2004 SQL Computer language to process relational database Data definition language (DDL): –Create table, alter table, and so on –Used to define a table’s column, add or delete columns, and delete unneeded tables Data manipulation language(DML): –Insert into, update, delete, and select –Used to insert, update, delete, and retrieve data in a table

8 © UW Business School, University of Washington 2004 Creating and Dropping Tables CREATE TABLE tableName (field1 dataType, field2 dataType, …) CREATE TABLE tableName (field1 dataType PRIMARY KEY, field2 dataType, …) DROP TABLE tableName

9 © UW Business School, University of Washington 2004 Inserting Data Into a Table INSERT INTO TABLE tableName VALUES (value1, value2, …) or INSERT INTO TABLE tableName (field1, field2, …) VALUES ( value1, value2, …)

10 © UW Business School, University of Washington 2004 Updating Table Data UPDATE tableName SET field1=value1, fiedl2=value2, … WHERE conditions The WHERE clause gives the condition for selecting which rows (records) are to be updated in the table identified as tableName The SET keyword is followed by the field list to be updated If the WHERE clause is omitted, all rows in the table are updated

11 © UW Business School, University of Washington 2004 Deleting Records from a Table DELETE FROM tableName WHERE conditions –This deletes all rows that satisfy the WHERE clause in the statement –If there is no WHERE clause, then all rows in the table are deleted

12 © UW Business School, University of Washington 2004 Retrieving Data SELECT field1, field2, … FROM tableName WHERE conditions –The SELECT clause lists the fields retrieved in the query result, separated by commas –The FROM clause lists one or more table names to be used by the query –All fields listed in the SELECT or WHERE clauses must be found in one and only one of the tables listed in the FROM clause

13 © UW Business School, University of Washington 2004 An Access Example Select * from customers Select companyname, contactname, address, city From customers

14 © UW Business School, University of Washington 2004 It provides Excel-like user interface to display information from a database Syntax: Attributes: datasource – data source object … Methods: Databind() – binding the data from the datasource

15 © UW Business School, University of Washington 2004 Dataset Object A dataset object holds data from the DB on the server and is ready to be used to build an ASP.NET page.

16 © UW Business School, University of Washington 2004 Data Adapter Purpose: to retrieve a set of data from a data source and place it in a dataset. Instantiating a data adapter: –Dim dataAdapter As System.Data.IDbDataAdapter = New _ System.Data.OleDb.OleDbDataAdapter –Dim dataAdapter As New System.Data.OleDb.OleDbDataAdapter Property: –SelectCommand – statement to select records from DB –InsertCommand –DeleteCommand –UpdateCommand

17 © UW Business School, University of Washington 2004 OLE DB Command Purpose: command that can be executed Property: CommandText: SQL statement or procedure Connection: connection object

18 © UW Business School, University of Washington 2004 Six Steps to Connect to a DB Create a datagrid control Create a connection object Create a string text to hold SQL statement Create a OLE DB command object and define the SQL command and connection properties Create a data adapter object and define its command property Use the Fill() method to transfer data to data set object