Intro to ASP'NET: Data Access - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Intro to ASP'NET: Data Access

Description:

Successor of ADO ActiveX Data Objects ... Only active when transferring data disconnected otherwise ... New Controls in v2.0. DataSource. Substitutes ... – PowerPoint PPT presentation

Number of Views:139
Avg rating:3.0/5.0
Slides: 22
Provided by: Gala99
Category:
Tags: asp | net | access | active | control | data | intro

less

Transcript and Presenter's Notes

Title: Intro to ASP'NET: Data Access


1
Intro to ASP.NET Data Access
  • By Slaveyko Ingilizov

2
Outline
  • Intro to ADO.NET
  • Goals in ADO.NETs design
  • ADO.NET Architecture
  • Connection Objects
  • Command Objects
  • DataReader Objects
  • DataSets and DataAdapters
  • New controls in v2.0

3
Intro to ADO.NET
  • Successor of ADO ActiveX Data Objects
  • Collection of objects facilitating data access,
    part of the .NET class library
  • System.Data namespace

4
ADO.NET
  • Interoperability all data transported as XML,
    can be read on any platform
  • Scalability disconnected datasets. No
    client-server model.
  • Productivity numerous ready-to-use features
    saving time
  • Performance disconnected no resources wasted
    on the DB server

5
ADO.NET Architecture
  • Two main groups of classes
  • Content components Hold actual in-memory
    representation of data
  • e.g. DataSet, DataTable, DataView
  • Managed-provider components communicate with
    the database to retrieve and write data
  • e.g. Connection, Command, DataReader

6
ADO.NET Architecture
7
Database Connections
  • Provide the way of communication with the
    database
  • Only active when transferring data disconnected
    otherwise
  • Provider-specific classes e.g. SQLConnection

8
Connections Demo
  • Connection Strings
  • Opening and closing connections

9
Commands
  • Contain the information submitted to the database
    e.g. SELECT queries.
  • Provider-specific classes e.g. SQLCommand.
  • Used to call stored procedures.
  • Support parameterized commands

10
Commands Demo
  • Command objects
  • ExecuteNonQuery() method
  • Parameters
  • Inserting data

11
DataReaders
  • Read-only, forward-only retrieval of data from
    the database.
  • Returned from a Command object.
  • Increased performance compared to DataSets and
    DataProviders, but only applicable in a limited
    number of cases.

12
DataReader Demo
  • ExecuteReader() method
  • Displaying data in a forward-only manner

13
DataSets and DataAdapters
  • DataSet contains an in-memory representation of
    data.
  • Supports multiple tables, relations, constraints
  • DataAdapter used to communicate with the
    database and fill the dataset.
  • Provider-specific classes e.g. SQLDataAdapter

14
DataSet and DataAdapter Demo
  • SqlDataAdapter
  • DataSet
  • Fill() method
  • DataGrid control
  • Binding to a DataSet

15
New Controls in v2.0
  • DataSource
  • Substitutes Connection and Command objects
  • Several types depending on database
  • GridView
  • Upgraded DataGrid
  • Supports sorting, paging, editing, deleting

16
New Controls Demo
  • SqlDataSource control
  • GridView control
  • Paging
  • Sorting
  • Updating
  • Deleting

17
What next?
  • Advanced data controls
  • DetailsView
  • FormView
  • Themes and styles
  • Master Pages
  • Security

18
References
  • http//www.asp.net
  • http//www.directionsonmicrosoft.com/
  • http//aspalliance.com
  • http//aspnet.4guysfromrolla.com/
  • http//www.123aspx.com/
  • http//www.aspnetresources.com/
  • http//www.aspexperts.com/
  • http//www.dotnetspider.com/tutorials/AspNet-Tutor
    ials.aspx
  • http//www.15seconds.com/
  • http//www.aspdev.org/

19
References Contd
  • ADO.NET in a Nutshell Bill Hamilton, Matthew
    MacDonald
  • ASP.NET Database Programming Weekend Crash Course
    Jason Butler, Tony Caudill
  • A Programmers Guide to ADO.NET in C - Mahesh
    Chand
  • C Developers Guide to ASP.NET, XML and ADO.NET
    Jeffrey McManus, Chris Kinsman
  • C .NET Web Developers Guide Adrian Turtschi,
    Jason Werry

20
Thank you!
21
Questions?
Write a Comment
User Comments (0)
About PowerShow.com