i

ASP.Net A Complete Guide

ASP.NET Data Providers

The main function of this is to connect to the database, execute commands, and fetch the records. We can place the data into the dataset.Below is some component of the data provider:

Sr.No

component

Description

1

Connection

 Provide the connection to specific data source

2

Command

Executes  the given command against a given data source

3

DataReader

Reads the stream of data from a given data source

4

DataAdapter

Populates a data set and resolves updates in the data source

Data Provider for Oracle:

It enables data access to Oracle data sources using the Oracle client connectivity software. The  System.Data.OracleClient namespace has all the required classes.

Below way we can use the Oracle namespace in the application:

  • Using System. Data; 

  • Using System.Data.OracleClient; 

Data Provider for SQL Server:

It is lightweight, and it provides better performance. The System.Data.SqlClient namespace has all the required classes for the data provider.

SQL Server provides the below classes:

SqlConnection: It is used to create the SQL Server connection object.

SqlCommand: It is used to execute database queries.

SqlDataAdapter: It has a set of commands to fill the DataSet.

SqlDataReader: Reads data from the SQL reader.

SqlException: This class is used to do the exception handling when SQL returns an exception.