Reputation: 444
From ASP.NET, I need to connect to SQL Server database and Oracle database.
From .NET, I can connect direct to SQL Server database (SqlClient.SqlConnection), and can connect via ODBC. The same with Oracle, can connect via (OracleClient) as well as ODBC.
My question is: Which is the best practice to connect to SQL Server database or Oracle database, via ODBC or direct, and what is performance effect?
Upvotes: 0
Views: 876
Reputation: 46223
It's best to use a managed provider from managed code. That would be SqlClient
for SQL Server and ODP.NET for Oracle. Both implement the ADO.NET IDb* interfaces if you need shared code for both.
Upvotes: 1