ThinClients Wartungs-Meldung eingebaut

This commit is contained in:
ms
2025-05-20 13:51:01 +02:00
parent d5e4555e6e
commit fbaa4f1c02
10 changed files with 197 additions and 74 deletions

View File

@@ -116,6 +116,28 @@ Public Class cSQL
cmd.ExecuteNonQuery()
con.Close()
End Sub
Public Shared Sub UpdateSQL_(ByVal table As String, ByVal values As Dictionary(Of String, Object), ByVal where As String, Optional ByVal DBConnect As String = "")
If DBConnect = "" Then DBConnect = Class1.DBConString
Using con As New SqlConnection(DBConnect),
cmd As New SqlCommand()
con.Open()
cmd.Connection = con
' Dynamisch SQL-Zeile aufbauen
Dim setParts As New List(Of String)
For Each kvp In values
setParts.Add(kvp.Key & " = @" & kvp.Key)
cmd.Parameters.AddWithValue("@" & kvp.Key, kvp.Value)
Next
cmd.CommandText = $"UPDATE {table} SET {String.Join(", ", setParts)} WHERE {where}"
cmd.ExecuteNonQuery()
End Using
End Sub
Public Shared Sub InsertSQL(ByRef table As String, ByRef insert As String, Optional ByRef DBConnect As String = "")
If DBConnect = "" Then DBConnect = Class1.DBConString