2 SQL Queries in 1 OLEDBCommand Object

G

Guest

Hi.
Is it possible to embed two sql queries ( or statements, whatever ) in just
one OLEDBCommand object, and execute them at the same time?

Dim t_cmd as new OLEDBCommand
t_cmd.CommandText="SELECT * FROM Sales;DROP TABLE Sales;"
..
..
..
t_adapter.Execute (t_cmd)

Will this code work?
 
G

Guest

The provider is OLEDB Jet 4.0 that will connect to a MDB file.

Miha Markic said:
Hi,

I believe this feature depends on provider...

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Mohammad-Reza said:
Hi.
Is it possible to embed two sql queries ( or statements, whatever ) in
just
one OLEDBCommand object, and execute them at the same time?

Dim t_cmd as new OLEDBCommand
t_cmd.CommandText="SELECT * FROM Sales;DROP TABLE Sales;"
.
.
.
t_adapter.Execute (t_cmd)

Will this code work?
 
G

Guest

Mohammad-Reza,

It is not possible with that provider.

Kerry Moorman


Mohammad-Reza said:
The provider is OLEDB Jet 4.0 that will connect to a MDB file.

Miha Markic said:
Hi,

I believe this feature depends on provider...

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Mohammad-Reza said:
Hi.
Is it possible to embed two sql queries ( or statements, whatever ) in
just
one OLEDBCommand object, and execute them at the same time?

Dim t_cmd as new OLEDBCommand
t_cmd.CommandText="SELECT * FROM Sales;DROP TABLE Sales;"
.
.
.
t_adapter.Execute (t_cmd)

Will this code work?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top