vb.net 如何修改数据库内容?
来源:百度知道 编辑:UC知道 时间:2024/09/26 02:17:47
Private Function データ修正() As Boolean
Dim strMsg As String = ""
Try
SQL.Length = 0
SQL.AppendLine("update M21_担当者マスタ set")
SQL.AppendLine("パスワード='" & editパスワード.Text & "',")
SQL.AppendLine("where 担当者番号='" & edit社员コード.Text & "'")
strMsg = ExecuteSQLNonQuery(SQL.ToString)
If strMsg <> "" Then
MessageBox.Show(strMsg, "データ修正", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
End If
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, "データ修正", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
End Try
End Function
Public Function ExecuteSQLNonQuery(ByVal vstrSQL As String) As String
Dim strRet As String = ""
Dim cnn As New SqlClient.SqlConnection(gsConSvr)
Dim cmm As New SqlClient.SqlCommand(vstrSQL