From 108936b0d4692a9217ef6400322685c85780b686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ku=C5=BAmicz?= Date: Thu, 17 Oct 2024 14:57:53 +0200 Subject: [PATCH 1/2] Database: improve DBNull parameter handling for ExecuteNonQuery --- .../UiPath.Database.Activities/ExecuteNonQuery.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Activities/Database/UiPath.Database.Activities/ExecuteNonQuery.cs b/Activities/Database/UiPath.Database.Activities/ExecuteNonQuery.cs index 76624947d..c98b42d69 100644 --- a/Activities/Database/UiPath.Database.Activities/ExecuteNonQuery.cs +++ b/Activities/Database/UiPath.Database.Activities/ExecuteNonQuery.cs @@ -105,7 +105,14 @@ protected async override Task> ExecuteInternalA var currentParam = Parameters[param.Key]; if (currentParam.Direction == ArgumentDirection.Out || currentParam.Direction == ArgumentDirection.InOut) { - currentParam.Set(asyncCodeActivityContext, param.Value.Value); + if (param.Value.Value != DBNull.Value) + { + currentParam.Set(asyncCodeActivityContext, param.Value.Value); + } + else + { + currentParam.Set(asyncCodeActivityContext, null); + } } } }; From 1efd358c286065d0ac18da30215bad8727266aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ku=C5=BAmicz?= Date: Thu, 17 Oct 2024 14:58:41 +0200 Subject: [PATCH 2/2] Database: improve DBNull parameter handling for ExecuteQuery --- .../Database/UiPath.Database.Activities/ExecuteQuery.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Activities/Database/UiPath.Database.Activities/ExecuteQuery.cs b/Activities/Database/UiPath.Database.Activities/ExecuteQuery.cs index 71788efec..5b8b579b8 100644 --- a/Activities/Database/UiPath.Database.Activities/ExecuteQuery.cs +++ b/Activities/Database/UiPath.Database.Activities/ExecuteQuery.cs @@ -110,7 +110,14 @@ protected async override Task> ExecuteInternalA var currentParam = Parameters[param.Key]; if (currentParam.Direction == ArgumentDirection.Out || currentParam.Direction == ArgumentDirection.InOut) { - currentParam.Set(asyncCodeActivityContext, param.Value.Value); + if (param.Value.Value != DBNull.Value) + { + currentParam.Set(asyncCodeActivityContext, param.Value.Value); + } + else + { + currentParam.Set(asyncCodeActivityContext, null); + } } } };