473,411 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

OLEDBCommand vs. SQLCommand

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
Dec 6 '06 #1
16 4677
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. 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
Dec 6 '06 #2

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
Dec 6 '06 #3
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
pa***********@libero.it 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
Dec 6 '06 #4
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" <an*******@icinema.comwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
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


Dec 6 '06 #5
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" <ro********@yahoo.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
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
pa***********@libero.it 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

Dec 6 '06 #6
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]" <so*****@nospam.comwrote in message
news:Oe**************@TK2MSFTNGP04.phx.gbl...
>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" <an*******@icinema.comwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
>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



Dec 6 '06 #7
Sorry, I don't know what you mean. Most of the things that run on SQL Server
are going to run on Oracle too. But every database system has its own
functions or additional syntax.

"Anil Gupte" <an*******@icinema.comwrote in message
news:ek**************@TK2MSFTNGP03.phx.gbl...
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]" <so*****@nospam.comwrote in message
news:Oe**************@TK2MSFTNGP04.phx.gbl...
>>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" <an*******@icinema.comwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
>>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




Dec 6 '06 #8
On Wed, 6 Dec 2006 23:23:45 +0530, 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.
How do you mean SQL Compliant?

All vendors support a standard SQL dialect, and then each vendor extends
this in their own way.
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 6 '06 #9
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]" <so*****@nospam.comwrote in message
news:Oe**************@TK2MSFTNGP04.phx.gbl...
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" <an*******@icinema.comwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
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

Dec 6 '06 #10
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" <ro********@yahoo.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>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]" <so*****@nospam.comwrote in message
news:Oe**************@TK2MSFTNGP04.phx.gbl...
>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" <an*******@icinema.comwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
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


Dec 6 '06 #11
im not positive that ODBC is slower

I've seen a half dozen situations where using ODBC is faster than OLE
DB... so in other words; MS has waffled on OLE DB; and VB.net is a
complete market failure.

So you'd have the best performance by going back to Access97
-Aaron
rowe_newsgroups wrote:
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. 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
Dec 6 '06 #12
On Wed, 6 Dec 2006 15:11:52 -0500, Marina Levit [MVP] wrote:
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.
From what I gather the Oracle one works better with the dizzying array of
things Oracle does ... might be a better bet for an Oracle application
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 6 '06 #13
Right, that is what I have heard too.

However, if one does not really want to deal with downloading and installing
it, then at least there is the one that Microsoft ships.

"Rad [Visual C# MVP]" <no****@nospam.comwrote in message
news:ix*****************************@40tude.net...
On Wed, 6 Dec 2006 15:11:52 -0500, Marina Levit [MVP] wrote:
>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.

From what I gather the Oracle one works better with the dizzying array of
things Oracle does ... might be a better bet for an Oracle application
--
Bits.Bytes
http://bytes.thinkersroom.com

Dec 6 '06 #14
so why don't the C# fags STFU and move out of OUR NEWSGROUP

-Aaron


Rad [Visual C# MVP] wrote:
On Wed, 6 Dec 2006 15:11:52 -0500, Marina Levit [MVP] wrote:
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.

From what I gather the Oracle one works better with the dizzying array of
things Oracle does ... might be a better bet for an Oracle application
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 6 '06 #15
Anil,

The normal advice is
Use a for a Database special made provider if that is available they are
mostly better scaled for that than OleDB.

If that is not, than use OleDB as long as you have the change to create the
connection (like password etc).

If it is completely closed than you can use ODBC.

To overcome the problems with different types of databases there is now the
factory.

What I have seen in this thread as confusion.

If there would be a price for giving the worst names to products, Microsoft
would win in my idea the first the second and the thirth place.

SQL server is just a name for a database server. It uses the SQL transact
language to process that in the same way as most DataBase servers as Oracle
do.

Cor


"Anil Gupte" <an*******@icinema.comschreef in bericht
news:uq**************@TK2MSFTNGP05.phx.gbl...
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


Dec 7 '06 #16
That is what I thought - SQL is a standard. But like every other standard,
I guess each vendor has their own version of it. My confusion was thinking
that SQL is the standard connection to use (not OLEDB) since SQL would be a
standard.

Anyway, I get it now.

Thanx (everyone) for your input.
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
Anil,

The normal advice is
Use a for a Database special made provider if that is available they are
mostly better scaled for that than OleDB.

If that is not, than use OleDB as long as you have the change to create
the connection (like password etc).

If it is completely closed than you can use ODBC.

To overcome the problems with different types of databases there is now
the factory.

What I have seen in this thread as confusion.

If there would be a price for giving the worst names to products,
Microsoft would win in my idea the first the second and the thirth place.

SQL server is just a name for a database server. It uses the SQL transact
language to process that in the same way as most DataBase servers as
Oracle do.

Cor


"Anil Gupte" <an*******@icinema.comschreef in bericht
news:uq**************@TK2MSFTNGP05.phx.gbl...
>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



Dec 7 '06 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jason Steeves | last post by:
-Dim cmd As OleDbCommand -cmd = New OleDbCommand("select * from qmsstats where firstname='jason'", OleDbConnection1) -OleDbDataAdapter2.SelectCommand = cmd -DataGrid1.Visible = True...
10
by: Henrik Dahl | last post by:
Hello! After I've finished using an instance of the SqlCommand class, should I then invoke Dispose() on the instance. I suppose so, as there is a Dispose method, but what does it actually...
4
by: Beringer | last post by:
Hello, I am trying to make a query against an Access Database File using OleDb part of the framework. I created an SQL Query string using Access and it will execute the query successfully in...
1
by: Tom | last post by:
Hello guys Please have a look on following paragraph from ".NET Data Access Architecture Guide". ''''''''''' Although you can repeatedly use the same SqlCommand object to execute the same...
3
by: Jason Huang | last post by:
Hi, In C#.Net, can we have more than one SqlCommand in a SqlConnection? And in one SqlCommand, can we have more than one SqlDataReader in a SqlCommand? In what situation should I use...
0
by: Agnes | last post by:
I got a silly question about Sqlcommand . In my form, there are 5 methods which use the same sqlcommand to execute reader. I had create and dispose for each sqlcommand in every method. Some said...
4
by: Agnes | last post by:
Dim authConnection As New OleDbConnection("Provider = VfpOleDB.1;Data Source = d:\cgl\vfpmaster\ttsdata\tts.dbc") authConnection.Open() Dim authCommand As String = "select loginid from coinfo...
1
by: job | last post by:
how is it possible to serialize/de-serialize a SqlCommand?
6
by: Frank Hauptlorenz | last post by:
Hello, I'm trying to send an SqlCommand to a WCF-Service. For this I'm using the following DataContract: public class SqlCommandComposite { SqlCommand cmd = new SqlCommand();
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.