HANDLING DATABASE WITH ADO.

NET

Two Ways to Work with Database: From a Programmer’s Perspective
1.

Using the built-in Visual Tools Using Code

3.

Connections, Data Adapters and Datasets
 These

are the objects you need to know to work with databases objects make-up the basis of ADO.NET, which is the primary access protocol in VB.NET

 These

1. CONNECTIONS

To work with data, you first connect to a data source to do that , you use a CONNECTION object.

4 type of connection objects  SQLConnection – recommended for MS SQL Server 7.0 or hicher  OLEDBConnection – recommended for MS SQL Server 6.5 or earlier  ODBCConnection  OracleConnection – recommended for Oracle data source

2. Adapters
 After

you have a connecion object for a data source, you create a data adapter to work with that data. is needed because data sets do not maintain any active connection to the database; they are disconnected from the database and connect only as needed.

 Adapter

Why do you need adapter?
 The

adapter is in-charge of managing your connection to the data source. It is the data adapter that connects you when you need to be connnected. is the place where you store the SQL statement that will be executed on the data in the database. fills your datasets with data

 It

 It

Types of Adapter
SQLDataAdapter 2. OLEDBDataAdapter 3. ODBCDataAdapter 4. OracleDataAdapter
1.

3. Datasets
 When

you have a data adapter object, you can generate a dataset object using the data adapter. are what you actually work with in your code when handling data.

 Datasets

DATASET CONNECTION ADAPTER Data Relation Table Rows Cols Database Table Rows Cols Your Code

Sign up to vote on this title
UsefulNot useful