Skip to content

Commit

Permalink
Dispose DbCommand in DbMetaDataFactory.ExecuteCommand
Browse files Browse the repository at this point in the history
A static analysis tool has flagged that DbCommand is an IDisposable, so
it should be Disposed() to free up resources.
  • Loading branch information
omajid committed Jun 17, 2024
1 parent f2bdb75 commit 8e6b2a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private DataTable ExecuteCommand(DataRow requestedCollectionRow, string?[]? rest
throw ADP.TooManyRestrictions(collectionName);
}

command = connection.CreateCommand();
using command = connection.CreateCommand();

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT_Libraries)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvossimulator-x64 Debug AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build maccatalyst-x64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_LLVMJIT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build linux-x64 release Runtime_Release)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT_Libraries)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build osx-x64 release Runtime_Release)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected

Check failure on line 125 in src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs#L125

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs(125,27): error CS1001: (NETCORE_ENGINEERING_TELEMETRY=Build) Identifier expected
command.CommandText = sqlCommand;
command.CommandTimeout = Math.Max(command.CommandTimeout, 180);

Expand Down

0 comments on commit 8e6b2a2

Please sign in to comment.