我的数据库 也是SQL SERVER2000 SP4
为了测试楼主的问题,我新建了一个表,并设置了两个字段kd_zuofei(bit) kd_xsdh(nvarchar)
经测试,未出现楼主所说的返回值不准确的情况。
下面是刚测试的代码
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim connStr As String = "SERVER=.;UID=sa;PWD=;DATABASE=ceshi"
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(connStr)
Dim cmd As SqlCommand = conn.CreateCommand
Dim sql As String = "update [admin] set [kd_zuofei]=0 where [kd_xsdh]='user'"
conn.Open()
= sql
MsgBox(cmd.ExecuteNonQuery)
conn.Close()
End Sub
为了测试楼主的问题,我新建了一个表,并设置了两个字段kd_zuofei(bit) kd_xsdh(nvarchar)
经测试,未出现楼主所说的返回值不准确的情况。
下面是刚测试的代码
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim connStr As String = "SERVER=.;UID=sa;PWD=;DATABASE=ceshi"
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(connStr)
Dim cmd As SqlCommand = conn.CreateCommand
Dim sql As String = "update [admin] set [kd_zuofei]=0 where [kd_xsdh]='user'"
conn.Open()
= sql
MsgBox(cmd.ExecuteNonQuery)
conn.Close()
End Sub
===================================================
讨厌C#的行尾的小尾巴;和一对大括号{ }
===================================================