SQLConnection vs. OLEDbConnection

  • Thread starter Thread starter Curtis
  • Start date Start date
C

Curtis

Which is preferred or what is the difference? SQLConnection or
OLEDbConnection.

We are connecting to data in MSSQL2000 primarily through stored procedures.
 
The classes in the SqlClient Namespace have been specifically designed to
work with SQL Server 7 and up. There's a whole extra in those classes
(SqlConnection, SqlCommand, etc) specific to SQL Server which you won't find
in the classes under the OLEDb namespace (OLEDbConnection, OLEDbCommand,
etc). Also, various optmizations have been built into these classes keeping
SQL Server in mind which cannot be in the more generic OLEDb classes. You
should use the classes in the SqlClient namespace unless you have a good
reason not to. So I would suggest using SqlConnection for SQL Server 2000
and also using the remaining classes in the SqlClient namespace for data
access.


hope that helps..
Imran.
 
hi.. I have recently just completed a project using entirely sqlxxx ado.net
command set ... however one customer has some Win98 system and sqlxxx
commands don't work .. have to take great pain to change all to OLEDBxxxx
...(not aware of any documentation mentioned about this....or i could have not
dig deep enough to find them..)
so my very own conclusion is SQLxxx is faster but OLEDBxxx is safer for
compatibility....

Albert
 
Windows 98 is a supported platform for the classes in the SqlClient
namespace. Lookup the documentation for any of the classes and you should
see that. AFAIK, you need to make some changes with the Sql Server
configuration (or rather MSDE configuration since I don't think Sql Server
2000 runs on Windows 98) so as to get it to work correctly. Apart from that,
the classes should work fine.

hope that helps..
Imran.
 
Back
Top