ADO.Net (Active Data Objects)
We have 4 Managed Providers in ADO.Net(Managed Provider is nothing but a .Net dll file)
1)System.Data.SqlClient - Managed Provider for SqlServer
2)System.Data.OracleClient - Managed Provider for Oracle
3)System.Data.Oledb - Managed Provider - can be used for any database which has Oledb provider (for COM Based Components).It is Object Oriented.
4)System.Data.Odbc - Managed Provider for Odbc Drivers - This can be used for all databases i.e Generic, but it would be slow compared to a managed provider specific to a given database.(for Win32 based).No Object Orientation .Not recommended.
Important Objects In Managed Provider:
1)Connection- Connection object encapsulates the functioanality of establishing a communication path over the sockets.In .Net, Connections are 'Pooled' we can make by default 100 simultaneous connections max without closing but obviously we have to close every connection opened only then it can be reused 'Pooled' means keeps the connection for the short period of time.The connection Pooling can be customized by setting appropriate parameters in ConectionString of Connection Object.
2)Command- Command Object can be used for execution of any type of Sql Statement.
When "Select" or similar type of sql statement is executed a new cursor is created on the back end.This cursor contains primary key or indexed key of the table on which the statement is executed.There is also a pointer,which is by default positioned at BOF.The cursor and pointers functionality is encapsulated by the "DataReader" object created in the front end.Using this object,we can move the pointer in the forward direction getting one record from backend into the front-end at a time.The cursor managed by Data Reader is read-only and forward-only.
No comments:
Post a Comment