OleDb and SqlClient are both called as Data Providers in .net
They are basically namespaces which contain specific classes used for connectivity and for
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 |