VB.NET可以直接执行像VB 6这样的sql命令吗? [英] Can VB.NET directly execute sql command like VB 6??

查看:44
本文介绍了VB.NET可以直接执行像VB 6这样的sql命令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.NET可以直接执行sql命令进行插入,更新和

删除但不使用数据adapter.insertcomand,adapter.deletecomand,

adapter.updatecomand?


就像在VB6中一样,我可以直接使用sql来做那种动作。


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

推荐答案

嗨Alan,


而且,哎呀,对不起 - 我一直在看着Bob的名字,而不是你的名字!


问候,

Fergus
Hi Alan,

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

Regards,
Fergus


嗨Alan,


这是一次错误的修正。双哟!很抱歉在那里给你一个错误的希望。运气好的话,

早上会有一些阳光灿烂的家伙。


另一方面,他们可能会建议
news://msnews.microsoft.com/microsof...amework.adonet

作为另一种智慧来源。


问候,

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/microsof...amework.adonet
as an alternative source of wisdom.

Regards,
Fergus


Alan


一般来说,我们现在可以在断开模式下使用我们的数据集,因此需要

for dataadapter


您可以使用

sqlcommand对象对SQL服务器执行sql脚本行


dim con作为新的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.Exec uteNonQuery()


让我知道如果这还没有回答你的问题


问候


Jody


" alan" < SM ***** @ sinaman.com>在消息中写道

news:b3 ************************** @ posting.google.c om ...
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...
VB.NET可以直接执行sql命令进行插入,更新和删除但不使用数据adapter.insertcomand,adapter.deletecomand,
adapter.updatecomand?

就像在VB6中一样,我可以直接使用sql来做那种动作。

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



这篇关于VB.NET可以直接执行像VB 6这样的sql命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆