From 8c2693015d32132fabbe750ae2d5fa49e8698833 Mon Sep 17 00:00:00 2001 From: Jochen Wezel Date: Thu, 28 Mar 2024 16:21:24 +0100 Subject: [PATCH] fixed NotSupportedException in WriteDataTableToDataConnection * fixed NotSupportedException on unnecessary call of AddMissingColumnsCommandText for NoDDL mode --- CompuMaster.Data/GlobalSuppressions.vb | 1 + CompuMaster.Data/Manipulation.vb | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CompuMaster.Data/GlobalSuppressions.vb b/CompuMaster.Data/GlobalSuppressions.vb index 7ee9319..a9a0235 100644 --- a/CompuMaster.Data/GlobalSuppressions.vb +++ b/CompuMaster.Data/GlobalSuppressions.vb @@ -14,3 +14,4 @@ Imports System.Diagnostics.CodeAnalysis + diff --git a/CompuMaster.Data/Manipulation.vb b/CompuMaster.Data/Manipulation.vb index 90aba32..4c625ce 100644 --- a/CompuMaster.Data/Manipulation.vb +++ b/CompuMaster.Data/Manipulation.vb @@ -2,6 +2,7 @@ Option Strict On Imports System.Data +Imports System.Data.Common Imports CompuMaster.Data.Strings Namespace CompuMaster.Data @@ -156,9 +157,11 @@ Namespace CompuMaster.Data End If 'Extend schema if required - Dim extendSchemaCommandText As String = AddMissingColumnsCommandText(sourceTable, RemoteTable, ddlLanguage) - If extendSchemaCommandText <> Nothing Then - CompuMaster.Data.DataQuery.ExecuteNonQuery(dataConnection, extendSchemaCommandText, CommandType.Text, Nothing, CompuMaster.Data.DataQuery.Automations.None, 0) + If ddlLanguage <> DdlLanguage.NoDDL Then + Dim extendSchemaCommandText As String = AddMissingColumnsCommandText(sourceTable, RemoteTable, ddlLanguage) + If extendSchemaCommandText <> Nothing Then + CompuMaster.Data.DataQuery.ExecuteNonQuery(dataConnection, extendSchemaCommandText, CommandType.Text, Nothing, CompuMaster.Data.DataQuery.Automations.None, 0) + End If End If RemoteTable = LoadTableStructureWith1RowFromConnection(remoteTableName, dataConnection, False)