can anybody tell me what are the advantages of oledb connection over sql connection
+2
A:
SqlConnection
only works with SQL Server, but OleDbConnection
works with any OLEDB data source.
Dean Harding
2010-05-04 06:13:50
A:
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.
Lex Li
2010-05-04 07:46:48