[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


SQLConnection vs. OLEDbConnection

Posted on 2009-04-21
Medium Priority
Last Modified: 2012-08-13

Our system will allow users to add different OLEDB connections to connect to different databases. The user choose a provider and other parameters for that OLEDB.

Do you recommend that the program check what provider the user choose and make different connections?

For example, the user add an MSDAORA (oracle) then we make an OLEDbConnection and if the user choose SQLOLEDB we make a SQLConnection or doesn't it matter? Is it bad practice to use OLEDbConnection all the time? (much easier to code...)

I guess most of you will say , use SQLConnection if it's SQL Server, but what's the benefit to  make a SQLConnection instead of an OLEDBConnection with SQLOLEDB or SQLNCLI as the provider?

Question by:xlmaster200
LVL 32

Accepted Solution

Daniel Wilson earned 2000 total points
ID: 24196529
>> but what's the benefit to  make a SQLConnection instead of an OLEDBConnection with SQLOLEDB or SQLNCLI as the provider?

Efficiency.  One less middle-man layer.

Is that worth the additional complexity?  That depends on the efficiency requirements of the application.

btw, there's an Oracle .Net provider that's more efficient that the OleDB one also.  If you're interested in top efficiency, you'll use the most appropriate provider each time, falling back to OleDB only when necessary.  The code does get more complex that way, however.

Author Comment

ID: 24201756
Hi, thanks for your answer.

I'll try to follow your advice.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
What we learned in Webroot's webinar on multi-vector protection.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Starting up a Project

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question