ADO.NET (ActiveX Data Objects)
.NET uses ADO.NET (Activex Data Objects) as its primary data access and manipulation protocol.
Database programming can be done thru Controls and Coding.
Database Programming can be done using MS Access, Oracle, MS SQL Server or any ODBC Complaint Database. (Open Database Connectivity).
Steps for database programming :
- Establish connection with database using respective provider and driver.
- Open database.
- Store, Delete, Modify or Read data.
- Show/Process the data
- Close database.
Required Namespaces for Providers
| ACCESS | System.Data.Oledb |
| Oracle | System.Data.OracleClient |
| SQL Server | System.Data.SqlClient |
| ODBC | System.Data.ODBC |
Classes of respective Namespaces
| ACCESS | Oracle | SQL Server | ODBC |
|---|---|---|---|
| OleDbConnection | OracleConnection | SqlConnection | OdbcConnection |
| OleDbDataAdapter | OracleDataAdapter | SqlDataAdapter | OdbcDataAdapter |
| OleDbDataReader | OracleDataReader | SqlDataReader | OdbcDataAdapter |
| OleDbCommand | OracleCommand | SqlCommand | OdbcCommand |
| DataSet(System.Data) | DataSet | DataSet | DataSet |
Connected Database Programming :
In this type of program client is always connected with server and data is retrieved from it continuously. If you close the connection then we can’t read data. In this type of programming we have to use SqlConnection, SqlCommand, SqlDataReader Classes.
Sequence to use classes in CONNECTED Database Programming
- OledbConnection
- OledbDataReader
- OledbCommand








