Re: OLEDBCommand vs. SQLCommand
- From: "Marina Levit [MVP]" <someone@xxxxxxxxxx>
- Date: Wed, 6 Dec 2006 15:11:52 -0500
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
.
- Follow-Ups:
- Re: OLEDBCommand vs. SQLCommand
- From: Rad [Visual C# MVP]
- Re: OLEDBCommand vs. SQLCommand
- References:
- OLEDBCommand vs. SQLCommand
- From: Anil Gupte
- Re: OLEDBCommand vs. SQLCommand
- From: Marina Levit [MVP]
- Re: OLEDBCommand vs. SQLCommand
- From: Anil Gupte
- Re: OLEDBCommand vs. SQLCommand
- From: rowe_newsgroups
- OLEDBCommand vs. SQLCommand
- Prev by Date: Drag and Drop from Listview to Textbox
- Next by Date: Re: Email Socket Question
- Previous by thread: Re: OLEDBCommand vs. SQLCommand
- Next by thread: Re: OLEDBCommand vs. SQLCommand
- Index(es):
Relevant Pages
|