This commit is contained in:
SchreiberM
2016-05-17 14:05:44 +02:00
parent d0bb9cb0b9
commit 621a6cd469
20 changed files with 4547 additions and 5186 deletions

View File

@@ -141,7 +141,7 @@ Public Class frmSAP_FuBa
End If
'######
Dim i = 0
Dim tablename = "[DD_ECM].[dbo].[TPPMO_SAPFUBA_ " & TempTableNameTextBox.Text & "]"
Dim tablename = "[TPPMO_SAPFUBA_" & TempTableNameTextBox.Text & "]"
Dim createtablesql = "CREATE TABLE TPPMO_SAPFUBA_" & TempTableNameTextBox.Text & " ("
@@ -157,11 +157,15 @@ Public Class frmSAP_FuBa
Dim check = String.Format("SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='{0}'", tablename)
If ClassDatabase.Execute_Scalar(check) = 1 Then
If LogErrorsOnly = False Then ClassLogger.Add(">> TempTable " & tablename & " exists and will now be deleted!", False)
' ClassDatabase.Execute_non_Query_withConn("DROP TABLE " & tablename, 1)
End If
''Die Tabelle anlegen
If LogErrorsOnly = False Then ClassLogger.Add(">> Create Table: " & createtablesql, False)
ClassDatabase.Execute_non_Query_withConn(createtablesql, 1)
Dim del = "delete from " & tablename
ClassDatabase.Execute_non_Query_withConn(del, 1)
'If ClassDatabase.Execute_non_Query_withConn(createtablesql, 1) = False Then
' Me.Cursor = Cursors.Default
' MsgBox("Error while creating the temporary table. Please check the logfile!", MsgBoxStyle.Critical)
@@ -170,15 +174,29 @@ Public Class frmSAP_FuBa
Dim ins = "Insert into " & tablename & "("
Dim DT As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM " & tablename)
If Not IsNothing(DT) Then
Dim i As Integer = 0
For Each DataColumn In DT.Columns
ins = ins &
Dim anz As Integer = 0
For Each col As DataColumn In DT.Columns
If anz = 0 Then
ins = ins & col.ColumnName
Else
ins = ins & ", " & col.ColumnName
End If
anz += 1
Next
ins = ins & ") VALUES ("
End If
Try
For Each row As DataRow In SAPResulttable.Rows
Next
'For Each row As DataRow In SAPResulttable.Rows
' For x = 0 To CURRENT_COL_COUNT
' If x = 0 Then
' ins = ins & "'" & row.Item(x).ToString & "', "
' Else
' ins = ins & "'" & row.Item(x).ToString & "'"
' End If
' ins = ins & ")"
' Next
' ClassDatabase.Execute_non_Query_withConn(ins, 1)
'Next
Dim OwnerCS As String
OwnerCS = ClassDatabase.GetConnectionString(1)
Dim SQLconnect As New SqlClient.SqlConnection