ASP.NET Database Connectivity 1 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

ASP.NET Database Connectivity 1

Description:

ASP.NET Database Connectivity 1. 2. Outline. SQL Review. ASP.NET Database Connectivity ... The SELECT clause lists the fields retrieved in the query result, ... – PowerPoint PPT presentation

Number of Views:1420
Avg rating:3.0/5.0
Slides: 13
Provided by: saxserv
Category:

less

Transcript and Presenter's Notes

Title: ASP.NET Database Connectivity 1


1
ASP.NET Database Connectivity 1
2
Outline
  • SQL Review
  • ASP.NET Database Connectivity

3
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

4
ltaspGridViewgt
  • It provides Excel-like user interface to display
    information from a database
  • Syntax
  • ltaspGridView id"GridView1" runat"server" /gt
  • Attributes
  • datasource data source object
  • Methods
  • Databind() binding the data from the datasource

5
ADO.NET
  • ADO ActiveX Data Objects
  • ADO.NET
  • A set of class libraries in the .NET Framework
    that makes it easier to use database
  • These classes provide certain functionality
  • You can use the classes from VB or C

6
ADO.NET
SQL Server
OLE DB
Oracle
7
OLEDB
  • OLEDB Object Linking and Embedding for Databases
  • It can communicate with any database that is
    OLEDB-enabled, such as MySQL, DB2

8
Database Engine
  • JET, Joint Engine Technology
  • A database engine that runs in the background and
    uses MDB (Access) files
  • JET accepts commands directly from other software
    such as VB to read or modify MDB files
  • ACE (Access Engine) is the new database engine
  • It is backward compatible

9
Connection Object
  • An ADO.NET object that represents a unique path
    between a data user and data provider
  • Methods
  • open()
  • close()

10
Command Object
  • An ADO.NET object that represents an SQL
    statement that can be passed to a database
  • Method
  • ExecuteReader()
  • Creates a DataReader

11
DataReader
  • A storage of the data obtained from the database
  • Can only read data
  • It is discarded at the end of the request

12
Six Steps to Connect to a DB
  • Create a GridView control in the webpage
  • Create a connection object
  • Create a string text to hold SQL statement
  • Create a command object
  • Open connection
  • Create DataReader and send data to GridView
Write a Comment
User Comments (0)
About PowerShow.com