This commit is contained in:
ms
2019-10-24 16:47:06 +02:00
parent d3f95ae877
commit 18e00e475d
18 changed files with 3423 additions and 0 deletions

76
cSQL.vb Normal file
View File

@@ -0,0 +1,76 @@
Imports System.Data.SqlClient
Public Class cSQL
Public Shared Sub SQL2DS(ByRef selector As String, ByRef ds As DataSet)
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = cRes.DBConString
cmd.Connection = con
Dim dataadapter As New SqlDataAdapter(selector, con)
con.Open()
dataadapter.Fill(ds)
con.Close()
End Sub
Public Shared Sub UpdateSQL(ByRef table As String, ByRef values As String, ByRef where As String)
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = cRes.DBConString
cmd.Connection = con
con.Open()
cmd.CommandText = "UPDATE " & table & " SET " & values & " WHERE " & where & ""
cmd.ExecuteNonQuery()
con.Close()
End Sub
Public Shared Sub InsertSQL(ByRef table As String, ByRef insert As String)
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = cRes.DBConString
cmd.Connection = con
con.Open()
cmd.CommandText = "INSERT INTO " & table & " " & insert & ""
cmd.ExecuteNonQuery()
con.Close()
End Sub
Public Shared Sub DeleteSQL(ByRef table As String, ByRef where As String)
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = cRes.DBConString
cmd.Connection = con
con.Open()
cmd.CommandText = "DELETE FROM " & table & " WHERE " & where & ""
cmd.ExecuteNonQuery()
con.Close()
End Sub
End Class
Public Class SQLVariable
Private Text, Value As String
Private prim As Boolean
Public Sub New(ByVal btext As String, ByVal bvalue As String, Optional bprim As Boolean = False)
Me.Value = bvalue
Me.Text = btext
End Sub
Public ReadOnly Property SQLText() As String
Get
Return Text
End Get
End Property
Public ReadOnly Property SQLValue() As Object
Get
Return Value
End Get
End Property
End Class