1
ASP.Net using Database
2
ASP
.Net
VB
J#
ASP.Net
File
ADO.Net
Objects Database
Web Server
Client
HTTP Request
HTTP Response
Language
Engines
ADO.NET
ActiveX Data Objects (ADO) and its .Net version
ADO.Net are Microsoft’s answer to universal data
access - at least for all their languages
ADO.Net insulates the programmer from database
implementation details
Allows you to use SQL and ADO.Net objects to
accomplish most of your data access and
manipulation
3
ADO.Net Architecture
4Source: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconadonetarchitecture.asp
ADO.Net Basics
ADO.Net designed to separate data access from
data manipulation
Two central components of ADO.Net
.Net Framework Data Provider
 Connection
 Command
 DataReader
 DataAdapter
DataSet
 DataTableCollection
 DataRelationCollection
5
.Net Framework Data Providers
Object Description
Connection Establishes a connection to a specific data
source.
Command Executes a command against a data source.
Exposes Parameters and can execute within
the scope of a Transaction from a
Connection.
DataReader Reads a forward-only, read-only stream of data
from a data source.
DataAdapter Populates a DataSet and resolves updates with
the data source.
6
ADO.Net Basics
Two .Net Framework providers (by default)
SQL Server for all SQL Server databases
OLE DB for other databases
 Microsoft Access
7
Displaying Database Data
1. Create a data source and connect it to a database
through ASP.Net data control
2. Create an appropriate data display Web control
3. Link the Web control to the data source
4. Execute the Page
8
Database SQL
Display all records from Product table
SELECT * FROM Product
Display the record for attribute PCode=120 from
Product table
SELECT * FROM Product WHERE PCode=120
Display PCode, PName, and Price for PCode=120 from
Product table
SELECT PCode, PName, Price FROM Product WHERE
PCode=120
9
Database SQL
Display PCode, PName, and Price for
PName=‘Monitor’ from Product table
SELECT PCode, PName, Price FROM Product WHERE
PName=‘Monitor’
Display Client#, ClientName from Product table and
Trip#, TripDate, People from Booking table for
Client#=120
SELECT Client.[Client#], Client.ClientName, Booking.
[Trip#], Booking.TripDate, Booking.People FROM
Client INNER JOIN Booking ON Client.[Client#] =
Booking.[Client#] WHERE Client.[Client#]=120
10
Database SQL
Sum of People from Booking
SELECT Client.[Client#], Client.ClientName,
Sum(Booking.People) AS SumOfPeople FROM Client
INNER JOIN Booking ON Client.[Client#] = Booking.
[Client#] GROUP BY Client.[Client#],
Client.ClientName
Computed attribute
SELECT Product.ProdID, Product.ProdType,
Product.price, Product.stock, [price]*[stock] AS
StockValue FROM Product
11
Database Query
Creating a String variable that stores a SQL query
Dim s as String
s= “SELECT PCode, PName, Price FROM Product
WHERE PName=‘Monitor’”
A SQL query string that includes variable value
Dim s, m as String
m=“Monitor”
s= “SELECT PCode, PName, Price FROM Product
WHERE PName=‘” & m & “’”
12

More Related Content

PPTX
CodeMash 2013 Microsoft Data Stack
PDF
Data Binding and Data Grid View Classes
PPT
PPT
ASP.NET 08 - Data Binding And Representation
PDF
ASP.net Image Slideshow
PPTX
Ch 7 data binding
PPTX
Database connectivity to sql server asp.net
PDF
Form1.vb
CodeMash 2013 Microsoft Data Stack
Data Binding and Data Grid View Classes
ASP.NET 08 - Data Binding And Representation
ASP.net Image Slideshow
Ch 7 data binding
Database connectivity to sql server asp.net
Form1.vb

What's hot (19)

PPTX
ADO.NET -database connection
PPT
ADO.NET
PPT
Simple Data Binding
PPT
For Beginers - ADO.Net
PPT
Ado.net
PPTX
Chapter 3: ado.net
PPT
ASP.NET Session 11 12
PPT
Ado.net
PDF
Url programming
PPTX
Ado .net
PPT
2310 b 11
PPT
Data Access Mobile Devices
PPTX
PPSX
ADO.NET
DOCX
Simple ado program by visual studio
PPT
ASP.NET 09 - ADO.NET
PDF
Data Binding
PDF
Ado.Net
PPTX
Ch06 ado.net fundamentals
ADO.NET -database connection
ADO.NET
Simple Data Binding
For Beginers - ADO.Net
Ado.net
Chapter 3: ado.net
ASP.NET Session 11 12
Ado.net
Url programming
Ado .net
2310 b 11
Data Access Mobile Devices
ADO.NET
Simple ado program by visual studio
ASP.NET 09 - ADO.NET
Data Binding
Ado.Net
Ch06 ado.net fundamentals
Ad

Viewers also liked (6)

PDF
Twaitter
PDF
Bright student life!
PPT
分数的加法
PPTX
Redefining the Library of the Future
PDF
Sintesis informativa 15 04 2015
PDF
Southwest finland's occupational barometer
Twaitter
Bright student life!
分数的加法
Redefining the Library of the Future
Sintesis informativa 15 04 2015
Southwest finland's occupational barometer
Ad

Similar to Asp db (20)

PDF
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
PDF
Presentation on the ADO.NET framework in C#
PPTX
ADO .NET by Sonu Vishwakarma
PPTX
PATTERNS07 - Data Representation in C#
PPTX
Csharp_dotnet_ADO_Net_database_query.pptx
PPTX
Asp .Net Database Connectivity Presentation.pptx
PPT
Introduction to ado
PPTX
ADO.NET by ASP.NET Development Company in india
PPT
Synapseindia dot net development chapter 8 asp dot net
PPT
the .NET Framework. It provides the claf
PPTX
PDF
Database Programming with Visual Basic NET and ADO NET Tips Tutorials and Cod...
PPTX
Ado.net
PDF
Ado Fundamentals
PPSX
06 asp.net session08
DOCX
unit 3.docx
PPTX
Is2215 lecture7 lecturer_ado_intro
PPSX
07 asp.net session10
PDF
ASP.NET Unit-3.pdf
PPT
Chapter 4 event it theory programming.pptx
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
Presentation on the ADO.NET framework in C#
ADO .NET by Sonu Vishwakarma
PATTERNS07 - Data Representation in C#
Csharp_dotnet_ADO_Net_database_query.pptx
Asp .Net Database Connectivity Presentation.pptx
Introduction to ado
ADO.NET by ASP.NET Development Company in india
Synapseindia dot net development chapter 8 asp dot net
the .NET Framework. It provides the claf
Database Programming with Visual Basic NET and ADO NET Tips Tutorials and Cod...
Ado.net
Ado Fundamentals
06 asp.net session08
unit 3.docx
Is2215 lecture7 lecturer_ado_intro
07 asp.net session10
ASP.NET Unit-3.pdf
Chapter 4 event it theory programming.pptx

More from teach4uin (20)

PPTX
Controls
PPT
validation
PPT
validation
PPT
Master pages
PPTX
.Net framework
PPT
Scripting languages
PPTX
Css1
PPTX
Code model
PPTX
State management
PPT
security configuration
PPT
static dynamic html tags
PPT
static dynamic html tags
PPTX
New microsoft office power point presentation
PPT
.Net overview
PPT
Stdlib functions lesson
PPT
enums
PPT
memory
PPT
array
PPT
storage clas
PPT
Cprogrammingprogramcontrols
Controls
validation
validation
Master pages
.Net framework
Scripting languages
Css1
Code model
State management
security configuration
static dynamic html tags
static dynamic html tags
New microsoft office power point presentation
.Net overview
Stdlib functions lesson
enums
memory
array
storage clas
Cprogrammingprogramcontrols

Recently uploaded (20)

PDF
Physical pharmaceutics two in b pharmacy
PPTX
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
PPTX
Approach to a child with acute kidney injury
PPTX
principlesofmanagementsem1slides-131211060335-phpapp01 (1).ppt
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
PPSX
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
PDF
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
PDF
Diabetes Mellitus , types , clinical picture, investigation and managment
PPTX
Math 2 Quarter 2 Week 1 Matatag Curriculum
PPTX
operating_systems_presentations_delhi_nc
PPTX
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
PDF
IS1343_2012...........................pdf
PDF
FYJC - Chemistry textbook - standard 11.
PPTX
Diploma pharmaceutics notes..helps diploma students
PPTX
Neurological complocations of systemic disease
PDF
Health aspects of bilberry: A review on its general benefits
PPTX
Neurology of Systemic disease all systems
PPTX
Copy of ARAL Program Primer_071725(1).pptx
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
PPTX
GW4 BioMed Candidate Support Webinar 2025
Physical pharmaceutics two in b pharmacy
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
Approach to a child with acute kidney injury
principlesofmanagementsem1slides-131211060335-phpapp01 (1).ppt
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
Diabetes Mellitus , types , clinical picture, investigation and managment
Math 2 Quarter 2 Week 1 Matatag Curriculum
operating_systems_presentations_delhi_nc
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
IS1343_2012...........................pdf
FYJC - Chemistry textbook - standard 11.
Diploma pharmaceutics notes..helps diploma students
Neurological complocations of systemic disease
Health aspects of bilberry: A review on its general benefits
Neurology of Systemic disease all systems
Copy of ARAL Program Primer_071725(1).pptx
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
GW4 BioMed Candidate Support Webinar 2025

Asp db

  • 1. 1
  • 2. ASP.Net using Database 2 ASP .Net VB J# ASP.Net File ADO.Net Objects Database Web Server Client HTTP Request HTTP Response Language Engines
  • 3. ADO.NET ActiveX Data Objects (ADO) and its .Net version ADO.Net are Microsoft’s answer to universal data access - at least for all their languages ADO.Net insulates the programmer from database implementation details Allows you to use SQL and ADO.Net objects to accomplish most of your data access and manipulation 3
  • 5. ADO.Net Basics ADO.Net designed to separate data access from data manipulation Two central components of ADO.Net .Net Framework Data Provider  Connection  Command  DataReader  DataAdapter DataSet  DataTableCollection  DataRelationCollection 5
  • 6. .Net Framework Data Providers Object Description Connection Establishes a connection to a specific data source. Command Executes a command against a data source. Exposes Parameters and can execute within the scope of a Transaction from a Connection. DataReader Reads a forward-only, read-only stream of data from a data source. DataAdapter Populates a DataSet and resolves updates with the data source. 6
  • 7. ADO.Net Basics Two .Net Framework providers (by default) SQL Server for all SQL Server databases OLE DB for other databases  Microsoft Access 7
  • 8. Displaying Database Data 1. Create a data source and connect it to a database through ASP.Net data control 2. Create an appropriate data display Web control 3. Link the Web control to the data source 4. Execute the Page 8
  • 9. Database SQL Display all records from Product table SELECT * FROM Product Display the record for attribute PCode=120 from Product table SELECT * FROM Product WHERE PCode=120 Display PCode, PName, and Price for PCode=120 from Product table SELECT PCode, PName, Price FROM Product WHERE PCode=120 9
  • 10. Database SQL Display PCode, PName, and Price for PName=‘Monitor’ from Product table SELECT PCode, PName, Price FROM Product WHERE PName=‘Monitor’ Display Client#, ClientName from Product table and Trip#, TripDate, People from Booking table for Client#=120 SELECT Client.[Client#], Client.ClientName, Booking. [Trip#], Booking.TripDate, Booking.People FROM Client INNER JOIN Booking ON Client.[Client#] = Booking.[Client#] WHERE Client.[Client#]=120 10
  • 11. Database SQL Sum of People from Booking SELECT Client.[Client#], Client.ClientName, Sum(Booking.People) AS SumOfPeople FROM Client INNER JOIN Booking ON Client.[Client#] = Booking. [Client#] GROUP BY Client.[Client#], Client.ClientName Computed attribute SELECT Product.ProdID, Product.ProdType, Product.price, Product.stock, [price]*[stock] AS StockValue FROM Product 11
  • 12. Database Query Creating a String variable that stores a SQL query Dim s as String s= “SELECT PCode, PName, Price FROM Product WHERE PName=‘Monitor’” A SQL query string that includes variable value Dim s, m as String m=“Monitor” s= “SELECT PCode, PName, Price FROM Product WHERE PName=‘” & m & “’” 12