About OLEDB connection class :

  1. This class is used to open a connection with any type of data base and also used to start transactions.
  2. This class is inherited from System. Data. Common .Connection class,

Which is an abstract  class.


AS per above observations , all types of connection classes will be having same method names and same property names.


  1. Status:
  2. Server version:
  3. Connection String:
  4. Provider:


  1. open ()
  2. close ()
  3. Dispose ()
  4. Begin Transaction



Con. open ();

Con . close ();

Con.  Open ();

About oledb command class :

  • This class is used to execute DDL, DML, TCL, QL and Stored procedures.


DDL:  create, alter, drop

DML:  insert, delete, update

TCL: commit, rollback, save point

QL: select


Stored Procedure is a collection of SQL Statements.



  1. Connection
  2. Command Text
  3. Command Type
  4. Parameters



  1. Execute Non Query () :- is used to execute DDL, DML, TCL and stored procedure.
  2. Execute Reader (): need to be used when multiple records are expecting from a select statement.

Execute Reader ()   returns Data reader.

  1. Execute Scalar (): Search only for first match, it match is found ,then only first column value will be returned.




ENO           ENAME                   SAL

1                  Ravi                         5000

  1. Teja 9000
  2. Raj 8000
  3. .



Select * from EMP ;

Execute Reader  () ALL

Execute Scalar ()  ALL