473,395 Members | 1,623 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,395 software developers and data experts.

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

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
Nov 20 '05 #1
12 19237
Hi Alan,

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

Regards,
Fergus
Nov 20 '05 #2
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/microsof...amework.adonet
as an alternative source of wisdom.

Regards,
Fergus
Nov 20 '05 #3
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

"alan" <sm*****@sinaman.com> wrote in message
news:b3**************************@posting.google.c om...
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

Nov 20 '05 #4
Cor
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
dim cmd as new sqlCommand("insert into tbltable (f1,f2) values

Nov 20 '05 #5
* "Fergus Cooney" <fi*****@post.com> scripsit:
On the other hand they may suggest
news://msnews.microsoft.com/microsof...amework.adonet
as an alternative source of wisdom.


Policeman!

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
you could have a look at this
http://msdn.microsoft.com/library/de...ml/daab-rm.asp
code would be
SqlHelper.ExecuteNonQuery(gstrCnn, CommandType.Text, "insert into tbltest
....")
"alan" <sm*****@sinaman.com> wrote in message
news:b3**************************@posting.google.c om...
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

Nov 20 '05 #7
Cor
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
Nov 20 '05 #8
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

"alan" <sm*****@sinaman.com> wrote in message
news:b3**************************@posting.google.c om...
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

Nov 20 '05 #9
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.

"Cor" <no*@non.com> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #10
Cor
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, 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.

Nov 20 '05 #11
* "Cor" <no*@non.com> scripsit:
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>
Nov 20 '05 #12
Night porter in a busy conference centre?
Nov 20 '05 #13

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

Similar topics

1
by: Valentine Kouznetsov | last post by:
Hi, simple question, how to execute command in current shell, not in subshell? Example. I have environment variable A=aaa and need to invoke shell (sh) script which will do something with A. If...
2
by: david Wilton | last post by:
Hi all, Does anyone know how to execute command line in ASP? thanks David
1
by: josh | last post by:
anybody know why "edit-and-execute-command" doesn't work in python's readline? it doesn't even show up in a dump of readline functions: $ cat fc_test C-p: dump-functions C-e:...
1
by: Matt | last post by:
I used to execute a command line script in IIS 4 using Dynuexec. This is a third part server object I installed on the server (http://www.dynu.com/dynuexec.asp). I installed this object onto my...
4
by: alberto | last post by:
How can I execute a command of the operating system like "cls" from a C# code? Thank you
1
by: shubhangi | last post by:
Hi, Please check following code. In below code I don't want to display results of "execute (@sql)", but want @cntA to be displayed. Is there any command to stop display of execute command as per...
2
by: Michael | last post by:
Question. Is it possible to run Server.execute command inside global.asa file. if it is where. Inside Application onstart? Another ideas appreciated. Michael
23
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; ...
7
by: sonet | last post by:
in perl we can execute command and get result(command line stdout) by $a=`cmdline parameter`; print $a; in c system('cmdline parameter'); but i can not get the result (command line stdout).
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.