Can VB.NET directly execute sql command like VB 6??

  • Thread starter Thread starter alan
  • Start date Start date
A

alan

Can VB.NET directly executing the sql command for insert, update and
delete but not using data adapter.insertcomand, adapter.deletecomand,
adapter.updatecomand?

Just like in VB6 , I can directly using sql to do that kind of action.

Alan
 
Hi Alan,

And, oops, sorry - I've been looking at Bob's name instead of yours!

Regards,
Fergus
 
Hi Alan,

That was an erroneous correction. Double oops! Sorry to give you a false
ray of hope there. With any luck there will be some bright sunny guys in the
morning.

On the other hand they may suggest
news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet
as an alternative source of wisdom.

Regards,
Fergus
 
Alan

Generally we now work with our datasets in disconnected mode thus the need
for the dataadapter

You can execute lines of sql script against an SQL server by using the
sqlcommand object

dim con as new sqlConnection("Server=servername; database=dbname
username=username password=pwd")
dim cmd as new sqlCommand("insert into tbltable (f1,f2) values
('hi','goodbye')",con)
con.open

cmd.ExecuteNonQuery()

let me know if this hasn't answered your question

Regards

Jody
 
Hi Alan,

In addition to Jody's answer.

I saw in a post line below this that you are using Oledb, it exist also as
Oledbcommand

Cor
 
* "Fergus Cooney said:
On the other hand they may suggest
news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet
as an alternative source of wisdom.

Policeman!

;-)
 
Hi Herfried,

I have 5 times made a message like this and 5 times deleted it again.

It took al long time for me to find something that i could add to the answer
of Jody, because that was a short and complete answer in my eyes. Happenly I
found it in the thread beneath it..

:-)

Please mark your OT messages with OT?

:-)))))))))))))))))))))))))))))))))))))))))))))

Cor
 
Alan,
In addition to the other's comments. David Sceppa's book "Microsoft
ADO.NET - Core Reference" provides a wealth of knowledge on everything
ADO.NET. It is an easy read to learn about ADO.NET, plus a good desk
reference for double checking things later.

The above book goes into how the data Connection objects are related to the
data Adapter objects, data Command objects, and data Reader objects.

It then goes into the related (yet independent) DataSet family of objects
(DataSet, DataTable, DataRelationship, DataColumn and DataView).

It covers some of the more powerful & useful features of ADO.NET that many
developers can overlook.

Hope this helps
Jay
 
Cor, just a quick language tip... "Happenly" is not a word in English... I
assume you're translating "erfreulicherweise", but it doesn't translate
directly... the best translation is "Fortunately" or "Luckily" (like
glucklicherweise). That's all, just wanted to let you know.

Mike

--


Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
 
Hi Mike,

Thank you, I am very happy that you told it. I used it without thinking. My
native language is Dutch; therefore those German words mean less for me than
the English equivalents. In Dutch the first sentence would be.

Dank je, ik ben erg blij dat je het vertelde.

Cor
 
* "Cor said:
Thank you, I am very happy that you told it. I used it without thinking. My
native language is Dutch; therefore those German words mean less for me than
the English equivalents. In Dutch the first sentence would be.

Dank je, ik ben erg blij dat je het vertelde.

In German:

Danke dir, ich bin sehr froh (or "erfreut") [darüber], dass du es (or
"das") gesagt hast.

Very similar too.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
 
Back
Top