Re: OLEDBCommand vs. SQLCommand



One clarification. You do not *have* to use OleDb for Oracle. Microsoft
ships an oracle proider with the 2.0 framework, and Oracle also has its own
which you can download from their site.

"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1165434821.761265.283470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanx for the clarification. By the way, it surprises me that Oracle is
not
SQL compliant - assuming that SQL is a general specification, not
something
invented by MS.

I think you're slightly confused. "SQL" stands for structured query
language and is used by almost all types of databases. Each database
molds the language in order to fit their product better, but all
"flavors" closely resemble each other. For example, Microsoft's SQL
Server uses T-SQL (transact SQL) to execute queries against it's
tables, while Oracle uses "Oracle SQL" to execute their queries. An
example of one of these changes in T-SQL is the "Inner Join" and "TOP
#" statements, these are not supported in Oracle, but Oracle can do the
same thing with just a few changes:

i.e.

//T-SQL Command

SELECT TOP 10 *
FROM tbl_Whatever
INNER JOIN tbl_Something ON tbl_Something.Somefield =
tbl_Whatever.SomeField

//The Same Command in Oracle

SELECT *
FROM tbl_Whatever, tbl_Something
WHERE tbl_Something.Somefield = tbl_Whatever.SomeField
AND rownum <= 10

Both of the above are considered to be SQL statements and both do the
same thing in there respective enviroments. The SQLClient classes are
just optimized to work with SQLServer, and will only work with SQL
Server. If you want to connect to Oracle database you have to use the
OleDb class. You can send SQL statements through the OleDb class to sn
Oracle database without any trouble - as long as they are valid SQL
statements (see above - if you pass the first SQL statement to Oracle
it will throw an error since it doesn't support Transact SQL)

In summary:

You can use either the SQLClient class, OleDb class, or ODBC class to
pass SQL statements to Microsoft SQL Server

You can use either the OleDb class or ODBC class to pass SQL statements
to any OleDb or ODBC complaint database (like Oracle, Access, Excel,
etc)

You can use the ODBC class to pass SQL statements to a ODBC compliant
database (Mimer, Firebird, etc)

Does that help explain it?

Thanks,

Seth Rowe


Anil Gupte wrote:
Thanx for the clarification. By the way, it surprises me that Oracle is
not
SQL compliant - assuming that SQL is a general specification, not
something
invented by MS.

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

"Marina Levit [MVP]" <someone@xxxxxxxxxx> wrote in message
news:OeaZDNUGHHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
I think under certain circumstances, the SqlClient namespace classes are
going to provide you with better performance. They may also provide you
with more access to SQL Server specific functionality.

If your application does not need any of this functionality, and what
you
are doing is not something that the SqlClient class can optimize for
you,
then I suppose you can use OleDb so that you can swap out different
types
of databases. If you are always using SQL Server though, then I see no
reason to not just always use the classes in SqlClient.

"Anil Gupte" <anil-list@xxxxxxxxxxx> wrote in message
news:uqMw73SGHHA.4116@xxxxxxxxxxxxxxxxxxxxxxx
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: Newline inserted?
    ... Are you processing individual SQL statements (does your file contain SQL ... DBI is not your best bet to do this. ... When I attempt to load this file into Oracle 10g using the DBI I get the ...
    (perl.dbi.users)
  • Re: OleDb contra SqlClient
    ... wie viel Performanceverlust in Sql dies kostet?). ... Was ist so schlecht mit OleDb und Oracle? ... >> Mich würde interessieren was Ihr macht wenn Ihr wählweise ein SQL oder ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Limit of 1050 columns for ANSI joins
    ... comprehensive than Oracle SQL. ... I'm trying not to have any auto-generated SQL on my system, ... Index your schema properly and think about the proper design. ...
    (comp.databases.oracle.server)
  • Re: I cant find a SETUP.EXE in the SQL Plus Client ??
    ... someone else's server for testing some SELECT statements I'm ... free client because I don't own the Oracle license. ... SQL statements. ... There is no documentation with that download. ...
    (comp.databases.oracle.tools)
  • Re: OleDb contra SqlClient
    ... OleDb nutzt sclicht und einfach für jemanden der nicht mit Datenbanken ... OleDb und Oracle ist "interessant". ... > wie viel Performanceverlust in Sql dies kostet?). ... >> OracleCOnnection oder eine SqlConnection erstellt. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)