You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

Imports System.Data.SqlClient
Imports System.Data.SqlDbType
Imports System.IO
Public Class clsdb
Dim m_connectionstring As String
Property Connectionstring As String
Get
Return m_connectionstring
End Get
Set(value As String)
m_connectionstring = value
End Set
End Property
Public dsdaten As New DataSet
Public dadaten As SqlDataAdapter
Dim sql As String
Sub New()
Dim ConnectionFilename As String = "edokaconn.cfg"
Dim path As String = ""
Dim fc As Integer = 0
Dim ofile As System.IO.File
Dim oread As System.IO.StreamReader
Dim sConnectionstring As String
oread = ofile.OpenText(ApplicationPath() + "\" + ConnectionFilename)
sConnectionstring = oread.ReadLine
sConnectionstring = Crypto.DecryptText(sConnectionstring, "HutterundMueller")
sConnectionstring = Left(sConnectionstring, Len(sConnectionstring) - 1)
sConnectionstring = sConnectionstring
oread.Close()
Me.Connectionstring = sConnectionstring
End Sub
Public Sub Get_data()
Try
dsdaten.Clear()
sql = "Select * from DBConnection_Umleitung"
dadaten = New SqlDataAdapter(sql, Connectionstring)
dadaten.Fill(dsdaten, "dbconn")
Catch
End Try
End Sub
Sub Update_Daten()
Try
Dim cb As New SqlCommandBuilder(dadaten)
dadaten.Update(dsdaten, dsdaten.Tables(0).TableName)
MsgBox("Änderungen wurden gespeichert")
Catch ex As Exception
MsgBox("Felher: " + ex.Message)
End Try
End Sub
End Class