请教一下大家关于VB.NET 使用SQL的连接问题!
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myConnection As SqlConnection
Dim connStr As String
connStr = "Server=192.168.0.20;database=data1;uid=sa;pwd=pwd;"
myConnection = New SqlConnection(connStr)
myConnection.Open()
Dim cmd As SqlCommand = New SqlClient.SqlCommand("update 表A set 部门='14' where 单据='1234567'")
???
myConnection.Close()
End Sub
End Class
请教一下大家在???那里应该怎么写才可以运行这个VB.NET更新语句
[解决办法]
cmd.ExecuteNoQuery();