Reputation: 1
can anybody tell me what are the advantages of oledb connection over sql connection
Upvotes: 0
Views: 742
Reputation: 63143
In practice, no advantage unless the database you use does not have good ADO.NET support.
For example, if you use SQL Server or Oracle, you should use SqlConnection or OracleConnection. If you use OleDbConnection here, you may lose certain features or performance.
As many database vendors still fail to provide good ADO.NET support, OleDbConnection is there for you to connect to them.
Personally I don't know many enterprise products switch from a DB vendor to another in its lifecycle, so I always go straight to SqlConnection or OracleConnection.
Upvotes: 0
Reputation: 72648
SqlConnection
only works with SQL Server, but OleDbConnection
works with any OLEDB data source.
Upvotes: 2