VB.Net OleDbDataReader Vs SqlDataReader

In ASP.Net (3.5)

What is the main difference between  
OleDbDataReader  Vs  SqlDataReader    ?
- performance, versatility, syntax.

Does it make a difference when the Connection in web.config is using providerName="System.Data.SqlClient"
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi dennisdominic,
All documentation of microsoft says that you should use SqlDataReader when you connect to a SQL Server database and OleDbDataReader when you connect to a database that doesn´t have a specific data provider (like access databases).
Because all DataReaders, including the OleDbDataReader, the SqlDataReader, and other managed provider's DataReaders implement the same IDataReader interface, they should all provide the same base set of functionality.
If your config is using System.Data.SqlClient, you are using a SQL Server database, so you should use SqlDataReader, that Microsoft recomends.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dennisdominicAuthor Commented:
Does it provide more flexibility in the Code to use OleDbDataReader, if I may change from SQL Server to other Database?
Exactly. It is the benefit of using OleDbDataReader: you can change of database type (SQL Server, Oracle, Access, MySQL, etc) without any changes to your code, just to your connection string.
But, if your application will use only one database, it´s better to use a specialized data provider.
dennisdominicAuthor Commented:
Will it be better performance wise if I use SqlDataReader on SQL Server?
All documentation says that. I use OleDb classes, cause my applications always have to work with several databases, and never had problems with performance.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.