DocSearchModul

This commit is contained in:
Digital Data - Marlon Schreiber
2019-05-08 17:20:20 +02:00
parent 3f5236ad65
commit cff2ec012c
43 changed files with 4012 additions and 1221 deletions

View File

@@ -83,29 +83,29 @@ Public Class ClassDatabase
Return Nothing
End Try
End Function
Public Shared Function Return_Datatable_CS(Select_anweisung As String, Conn_ID As Integer, Optional userInput As Boolean = False)
Public Shared Function Return_Datatable_CS(SQLCommand As String, Conn_ID As Integer, Optional userInput As Boolean = False)
Try
Dim ConString As String = Get_ConnectionString(Conn_ID)
LOGGER.Debug(">>> ReturnDatatable: " & Select_anweisung, False)
Dim SQLconnect As New SqlClient.SqlConnection
Dim SQLcommand As SqlClient.SqlCommand
SQLconnect.ConnectionString = ConString
SQLconnect.Open()
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = Select_anweisung
Dim oConString As String = Get_ConnectionString(Conn_ID)
LOGGER.Debug(">>> ReturnDatatable: " & SQLCommand, False)
Dim oSQLconnect As New SqlClient.SqlConnection
Dim oSQLcommand As SqlClient.SqlCommand
oSQLconnect.ConnectionString = oConString
oSQLconnect.Open()
oSQLcommand = oSQLconnect.CreateCommand
oSQLcommand.CommandText = SQLCommand
Dim adapter1 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQLcommand)
Dim dt As DataTable = New DataTable()
adapter1.Fill(dt)
SQLconnect.Close()
Return dt
Dim oSQLAdapter As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(oSQLcommand)
Dim oReturnDatatable As DataTable = New DataTable()
oSQLAdapter.Fill(oReturnDatatable)
oSQLconnect.Close()
Return oReturnDatatable
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical)
MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & SQLCommand, MsgBoxStyle.Critical)
End If
LOGGER.Info("Fehler bei Return_Datatable_CS: " & ex.Message, True)
LOGGER.Info("#SQL: " & Select_anweisung, False)
LOGGER.Info("#SQL: " & SQLCommand, False)
Return Nothing
End Try
End Function