What are the Differences between OleDb and SqlClient ?

 Posted by Ddd on 1/20/2011 | Category: ADO.NET Interview questions | Views: 9019 | Points: 40

OleDb and SqlClient are both called as Data Providers in .net

They are basically namespaces which contain specific classes used for connectivity and for

data handling.

OleDb is referred to as System.Data.OleDb

SqlClient is referred to as System.Data.SqlClient

OleDb: Object linking and Embedding database.


OleDb is used for connecting to any database like SQL Server, Access, Oracle, Excel.
We have to mention the appropriate provider to connect with the particular database.
This adds an extra layer for connetion and has performance impacts.

SqlClient is used for SQL Server only. (for SQL Server 7.0 onwards)
We do not have to mention the SQL Server provider.
For SQL Server 6.5 or lower we will have to use OleDb

SqlClient is faster than OleDb.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Prabhakar on: 1/22/2011 | Points: 10
SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It's faster than the Oracle provider, and faster than accessing database via the OleDb layer. It's faster because it accesses the native library.

Login to post response