From 04ab89d1f6ceb89f8e55a911ab51091d0c07837f Mon Sep 17 00:00:00 2001 From: GoldenretriverYT <49924528+GoldenretriverYT@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:19:36 +0200 Subject: [PATCH 1/2] Update SqliteBulkCopy.cs --- source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs b/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs index b59a6f876..cb5da4378 100644 --- a/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs +++ b/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs @@ -50,17 +50,27 @@ public void WriteToServer(IDataReader reader) mCommand.CommandText = $"insert into [{DestinationTableName}] ({mFieldNames.ToString().TrimEnd(',')}) values ({mParamNames.ToString().TrimEnd(',')})"; mCommand.Prepare(); - + while (reader.Read()) { + bool skipRow = false; + for (int i = 0; i < reader.FieldCount; i++) { if (parms[i] != null) { - parms[i].Value = reader.GetValue(i); + var v = reader.GetValue(i); + + if(v == null) { + Console.WriteLine("WARNING: Tried to insert null value"); + skipRow = true; + } + + parms[i].Value = v; } } - mCommand.ExecuteNonQuery(); + + if(!skipRow) mCommand.ExecuteNonQuery(); } mTransaction.Commit(); From 34b1949021c18f3ece46f55d0f034c5a42499fb2 Mon Sep 17 00:00:00 2001 From: GoldenretriverYT <49924528+GoldenretriverYT@users.noreply.github.com> Date: Wed, 16 Aug 2023 21:21:22 +0200 Subject: [PATCH 2/2] Remove debug output --- source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs b/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs index cb5da4378..e68583118 100644 --- a/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs +++ b/source/IL2CPU.Debug.Symbols/SqliteBulkCopy.cs @@ -62,7 +62,6 @@ public void WriteToServer(IDataReader reader) var v = reader.GetValue(i); if(v == null) { - Console.WriteLine("WARNING: Tried to insert null value"); skipRow = true; } @@ -100,4 +99,4 @@ public void Dispose() #endregion } -} \ No newline at end of file +}