Re: OLEDBCommand vs. SQLCommand



Thanx Seth & Pamela, that does help. I also realized that MS Acesss is not
just a scaled down SQL server, but accorind to my book it has a different
(JET) database engine. It is just an assumption that I made, thinking
Access is SQL Server lite.

--
Anil Gupte
www.keeninc.net
www.icinema.com

"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1165414658.905575.17400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Personally, I almost always use the OleDb classes. This is mainly
because when I wrote my "superclass" I wrote it to be compatible with
all the servers my company uses, meaning either OleDb or ODBC (and I
hate ODBC). If all we had were SQL Server databases I might change my
story but until then I'll stick with Oledb. I did a few searches for
the differences and one post from Bill Vaughn said the the OleDb class
realies on COM interop while the SQLClient is a truely native to SQL
Server versions 7 and up.

Hopefully someone will post a link to the differences between the two.

Thanks,

Seth Rowe


pamelafluente@xxxxxxxxx wrote:
rowe_newsgroups ha scritto:

I might be wrong here, but someone will surely correct me if I am:

As far as SQL statements go, all three commands use them to talk to the
database, the prefix before "Command" or "Connection" is an indicator
of what it can access, not how. With that said, the OleDbCommand's are
for communicating with any OLEDB providing databases, like Oracle,
Access, SQL Server, Excel, etc. However the SQLCommand is created
especially for Microsoft's SQL Server databases, providing some SQL
server specific features and better performance.

I have been always wondering about that. I have been using the OLEDB
against SQL server and it is fast. Is there any reason why , for
instance,
a query sent by the SQLCommand should be faster than the same query
sent via an OLEDBcommand ? And id the sql reader faster than the OLEdb
reader ?

I do not have this feeling. Has anyone some test about that?

I think that using OLEDB may give the advantage that if you change
the underlying DB you do not have to change the code. And this seems to
be a huge
reason to use it whenever possible.
Also the possibility to access the GUIDs is fundamental. And this is
another huge reason.

Actually I am not clear why the need sort of specialized connectors. If
there is a form of a specialization a generic connector should be smart
enough to use specialized function when connected to specific DBMS.

What not make all the oledb way? What do you guys think ??


Finally ODBC is used
for ODBC complaint databases (almost all databases are). However, ODBC
requires that you set up a DSN (data source name) before using it - or
at least it used to - and is less efficient than using OleDbCommands or
SQLCommands, but may be your only choice depending on the database.

Does that help?

Thanks,

Seth Rowe


Anil Gupte wrote:
When does one use one or the other? And why? I cannot imagine too
many
innstances where you would not want to use SQL statements when you
communicating with a database - even on a read-only basis. Plus
there is
the ODBCCommand class too - I understand that is an older
implementation and
is not used in .Net much, correct?

Thanx for any clarifications and perhaps web links to discussion on
this.
--
Anil Gupte
www.keeninc.net
www.icinema.com



.



Relevant Pages

  • Re: msde2000
    ... MSDE is the desktop version of SQL server. ... Basically, Access is a desktop application, MSDE is a database backend. ... go through OLEDB, so theoretically therefore it's arguably the fastest ...
    (microsoft.public.vc.language)
  • Re: Parameters Question
    ... OleDB the syntax for calling a stored procedure is the same as the ODBC ... The .NET Framework Data Provider for SQL Server does not support the ... In this case, you must use named parameters, as in the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Parameters Question
    ... Also as I said in my post, the reason I sometimes use OLEDB for both Access ... and SQL Server is so I can upsize the Access database to SQL Server and use ... Do you have an example of using named parameters with OLEDB for both Access ... It will work with question mark placeholders. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: oledbconnection v sqlconnection
    ... The OleDb provider is a one-size-fits-all data access interface that uses ... No two database engines have the same SQL so you'll have to ... actual low-level data access layer and exposes a common object layer that ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Allowing user selection of a datasource at run time?
    ... but you can build connection strings to connect to any OLEDB ... the SQL Server instances, which is much easier. ... I need to allow> a user to select a database to connect to at run time via a standard dialog> box. ... This causes the 'Data Link Properties' dialog box to appear> which allows the user to select an OLEDB data provider, and a database, etc. ...
    (microsoft.public.dotnet.framework.adonet)

Loading