diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/CoreLib/Interop/Unix/Interop.IOErrors.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/CoreLib/Interop/Unix/Interop.IOErrors.cs index 5babcd1d05..d23744fba2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/CoreLib/Interop/Unix/Interop.IOErrors.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/CoreLib/Interop/Unix/Interop.IOErrors.cs @@ -119,14 +119,14 @@ internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string pat if (isDirectory) { return !string.IsNullOrEmpty(path) ? - new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, path)) : - new DirectoryNotFoundException(SR.IO_PathNotFound_NoPathName); + new DirectoryNotFoundException(Strings.Format(Strings.IO_PathNotFound_Path, path)) : + new DirectoryNotFoundException(Strings.IO_PathNotFound_NoPathName); } else { return !string.IsNullOrEmpty(path) ? - new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : - new FileNotFoundException(SR.IO_FileNotFound); + new FileNotFoundException(Strings.Format(Strings.IO_FileNotFound_FileName, path), path) : + new FileNotFoundException(Strings.IO_FileNotFound); } case Error.EACCES: @@ -134,29 +134,29 @@ internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string pat case Error.EPERM: Exception inner = GetIOException(errorInfo); return !string.IsNullOrEmpty(path) ? - new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, path), inner) : - new UnauthorizedAccessException(SR.UnauthorizedAccess_IODenied_NoPathName, inner); + new UnauthorizedAccessException(Strings.Format(Strings.UnauthorizedAccess_IODenied_Path, path), inner) : + new UnauthorizedAccessException(Strings.UnauthorizedAccess_IODenied_NoPathName, inner); case Error.ENAMETOOLONG: return !string.IsNullOrEmpty(path) ? - new PathTooLongException(SR.Format(SR.IO_PathTooLong_Path, path)) : - new PathTooLongException(SR.IO_PathTooLong); + new PathTooLongException(Strings.Format(Strings.IO_PathTooLong_Path, path)) : + new PathTooLongException(Strings.IO_PathTooLong); case Error.EWOULDBLOCK: return !string.IsNullOrEmpty(path) ? - new IOException(SR.Format(SR.IO_SharingViolation_File, path), errorInfo.RawErrno) : - new IOException(SR.IO_SharingViolation_NoFileName, errorInfo.RawErrno); + new IOException(Strings.Format(Strings.IO_SharingViolation_File, path), errorInfo.RawErrno) : + new IOException(Strings.IO_SharingViolation_NoFileName, errorInfo.RawErrno); case Error.ECANCELED: return new OperationCanceledException(); case Error.EFBIG: - return new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_FileLengthTooBig); + return new ArgumentOutOfRangeException("value", Strings.ArgumentOutOfRange_FileLengthTooBig); case Error.EEXIST: if (!string.IsNullOrEmpty(path)) { - return new IOException(SR.Format(SR.IO_FileExists_Name, path), errorInfo.RawErrno); + return new IOException(Strings.Format(Strings.IO_FileExists_Name, path), errorInfo.RawErrno); } goto default; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs index 0da9396f54..88c07619c4 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs @@ -37,8 +37,8 @@ private static string GetGssApiDisplayStatus(Status majorStatus, Status minorSta string minorError = GetGssApiDisplayStatus(minorStatus, isMinor: true); return (majorError != null && minorError != null) ? - SRHelper.Format(SR.net_gssapi_operation_failed_detailed, majorError, minorError) : - SRHelper.Format(SR.net_gssapi_operation_failed, majorStatus.ToString("x"), minorStatus.ToString("x")); + StringsHelper.Format(Strings.net_gssapi_operation_failed_detailed, majorError, minorError) : + StringsHelper.Format(Strings.net_gssapi_operation_failed, majorStatus.ToString("x"), minorStatus.ToString("x")); } private static string GetGssApiDisplayStatus(Status status, bool isMinor) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssBuffer.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssBuffer.cs index 8bed992b93..f70aabfb68 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssBuffer.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssBuffer.cs @@ -32,7 +32,7 @@ internal int Copy(byte[] destination, int offset) int destinationAvailable = destination.Length - offset; // amount of space in the given buffer if (sourceLength > destinationAvailable) { - throw new NetSecurityNative.GssApiException(SRHelper.Format(SR.net_context_buffer_too_small, sourceLength, destinationAvailable)); + throw new NetSecurityNative.GssApiException(StringsHelper.Format(Strings.net_context_buffer_too_small, sourceLength, destinationAvailable)); } Marshal.Copy(_data, destination, offset, sourceLength); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs index 5f72e26625..f2b0bfc192 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs @@ -36,7 +36,7 @@ internal static partial class Crypto key?.Dispose(); Interop.Crypto.ErrClearError(); - throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, oid)); + throw new PlatformNotSupportedException(Strings.Format(Strings.Cryptography_CurveNotSupported, oid)); } return key; } @@ -69,7 +69,7 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) } else { - throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString())); + throw new PlatformNotSupportedException(Strings.Format(Strings.Cryptography_CurveNotSupported, curve.CurveType.ToString())); } SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByExplicitParameters( @@ -131,7 +131,7 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) if (rc == -1) { - throw new CryptographicException(SR.Cryptography_CSP_NoPrivateKey); + throw new CryptographicException(Strings.Cryptography_CSP_NoPrivateKey); } else if (rc != 1) { @@ -218,7 +218,7 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) if (rc == -1) { - throw new CryptographicException(SR.Cryptography_CSP_NoPrivateKey); + throw new CryptographicException(Strings.Cryptography_CSP_NoPrivateKey); } else if (rc != 1) { diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs index 1f9530594c..108b6a64e6 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs @@ -61,7 +61,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50 { if (innerContext.IsInvalid) { - throw CreateSslException(SR.net_allocate_ssl_context_failed); + throw CreateSslException(Strings.net_allocate_ssl_context_failed); } // Configure allowed protocols. It's ok to use DangerousGetHandle here without AddRef/Release as we just @@ -80,7 +80,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50 if (!Ssl.SetEncryptionPolicy(innerContext, policy)) { Crypto.ErrClearError(); - throw new PlatformNotSupportedException(SR.Format(SR.net_ssl_encryptionpolicy_notsupported, policy)); + throw new PlatformNotSupportedException(Strings.Format(Strings.net_ssl_encryptionpolicy_notsupported, policy)); } bool hasCertificateAndKey = @@ -111,7 +111,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50 { if (Interop.Ssl.SslCtxSetAlpnProtos(innerContext, sslAuthenticationOptions.ApplicationProtocols) != 0) { - throw CreateSslException(SR.net_alpn_config_failed); + throw CreateSslException(Strings.net_alpn_config_failed); } } } @@ -121,7 +121,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50 if (context.IsInvalid) { context.Dispose(); - throw CreateSslException(SR.net_allocate_ssl_context_failed); + throw CreateSslException(Strings.net_allocate_ssl_context_failed); } if (!sslAuthenticationOptions.IsServer) @@ -147,7 +147,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50 using (X509Chain chain = TLSCertificateExtensions.BuildNewChain(cert, includeClientApplicationPolicy: false)) { if (chain != null && !Ssl.AddExtraChainCertificates(context, chain)) - throw CreateSslException(SR.net_ssl_use_cert_failed); + throw CreateSslException(Strings.net_ssl_use_cert_failed); } } } @@ -196,7 +196,7 @@ internal static bool DoSslHandshake(SafeSslHandle context, byte[] recvBuf, int r if ((retVal != -1) || (error != Ssl.SslErrorCode.SSL_ERROR_WANT_READ)) { - throw new SslException(SR.Format(SR.net_ssl_handshake_failed_error, error), innerError); + throw new SslException(Strings.Format(Strings.net_ssl_handshake_failed_error, error), innerError); } } @@ -259,7 +259,7 @@ internal static int Encrypt(SafeSslHandle context, ReadOnlyMemory input, r break; default: - throw new SslException(SR.Format(SR.net_ssl_encrypt_failed, errorCode), innerError); + throw new SslException(Strings.Format(Strings.net_ssl_encrypt_failed, errorCode), innerError); } } else @@ -328,7 +328,7 @@ internal static int Decrypt(SafeSslHandle context, byte[] outBuffer, int offset, break; default: - throw new SslException(SR.Format(SR.net_ssl_decrypt_failed, errorCode), innerError); + throw new SslException(Strings.Format(Strings.net_ssl_decrypt_failed, errorCode), innerError); } } @@ -358,7 +358,7 @@ private static void QueryUniqueChannelBinding(SafeSslHandle context, SafeChannel if (0 == certHashLength) { - throw CreateSslException(SR.net_ssl_get_channel_binding_token_failed); + throw CreateSslException(Strings.net_ssl_get_channel_binding_token_failed); } bindingHandle.SetCertHashLength(certHashLength); @@ -430,7 +430,7 @@ private static int BioRead(SafeBioHandle bio, byte[] buffer, int count) int bytes = Crypto.BioRead(bio, buffer, count); if (bytes != count) { - throw CreateSslException(SR.net_ssl_read_bio_failed_error); + throw CreateSslException(Strings.net_ssl_read_bio_failed_error); } return bytes; } @@ -453,7 +453,7 @@ private static int BioWrite(SafeBioHandle bio, byte[] buffer, int offset, int co if (bytes != count) { - throw CreateSslException(SR.net_ssl_write_bio_failed_error); + throw CreateSslException(Strings.net_ssl_write_bio_failed_error); } return bytes; } @@ -496,14 +496,14 @@ private static void SetSslCertificate(SafeSslContextHandle contextPtr, SafeX509H if (1 != retVal) { - throw CreateSslException(SR.net_ssl_use_cert_failed); + throw CreateSslException(Strings.net_ssl_use_cert_failed); } retVal = Ssl.SslCtxUsePrivateKey(contextPtr, keyPtr); if (1 != retVal) { - throw CreateSslException(SR.net_ssl_use_private_key_failed); + throw CreateSslException(Strings.net_ssl_use_private_key_failed); } //check private key @@ -511,7 +511,7 @@ private static void SetSslCertificate(SafeSslContextHandle contextPtr, SafeX509H if (1 != retVal) { - throw CreateSslException(SR.net_ssl_check_private_key_failed); + throw CreateSslException(Strings.net_ssl_check_private_key_failed); } } @@ -520,7 +520,7 @@ internal static SslException CreateSslException(string message) // Capture last error to be consistent with CreateOpenSslCryptographicException ulong errorVal = Crypto.ErrPeekLastError(); Crypto.ErrClearError(); - string msg = SR.Format(message, Marshal.PtrToStringAnsi(Crypto.ErrReasonErrorString(errorVal))); + string msg = Strings.Format(message, Marshal.PtrToStringAnsi(Crypto.ErrReasonErrorString(errorVal))); return new SslException(msg, (int)errorVal); } @@ -547,7 +547,7 @@ public SslException(string inputMessage, int error) } public SslException(int error) - : this(SR.Format(SR.net_generic_operation_failed, error)) + : this(Strings.Format(Strings.net_generic_operation_failed, error)) { HResult = error; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs index b1996871d9..e796f7c661 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs @@ -51,7 +51,7 @@ internal static byte[] ConvertAlpnProtocolListToByteArray(List byte.MaxValue) { - throw new ArgumentException(SR.net_ssl_app_protocols_invalid, nameof(applicationProtocols)); + throw new ArgumentException(Strings.net_ssl_app_protocols_invalid, nameof(applicationProtocols)); } protocolSize += protocol.Protocol.Length + 1; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIAuthType.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIAuthType.cs index 8855379df7..cfec6e4e44 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIAuthType.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIAuthType.cs @@ -96,7 +96,7 @@ public unsafe int DecryptMessage(SafeDeleteContext context, ref Interop.SspiCli. if (status == 0 && qop == Interop.SspiCli.SECQOP_WRAP_NO_ENCRYPT) { NetEventSource.Fail(this, $"Expected qop = 0, returned value = {qop}"); - throw new InvalidOperationException(SR.net_auth_message_not_encrypted); + throw new InvalidOperationException(Strings.net_auth_message_not_encrypted); } return status; @@ -156,7 +156,7 @@ public unsafe int QueryContextAttributes(SafeDeleteContext context, Interop.Sspi } else { - throw new ArgumentException(SRHelper.Format(SR.SSPIInvalidHandleType, handleType.FullName), nameof(handleType)); + throw new ArgumentException(StringsHelper.Format(Strings.SSPIInvalidHandleType, handleType.FullName), nameof(handleType)); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPISecureChannelType.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPISecureChannelType.cs index c46f602221..1f0f472d40 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPISecureChannelType.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPISecureChannelType.cs @@ -97,12 +97,12 @@ public int EncryptMessage(SafeDeleteContext context, ref Interop.SspiCli.SecBuff public int MakeSignature(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber) { - throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException); + throw NotImplemented.ByDesignWithMessage(Strings.net_MethodNotImplementedException); } public int VerifySignature(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber) { - throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException); + throw NotImplemented.ByDesignWithMessage(Strings.net_MethodNotImplementedException); } public unsafe int QueryContextChannelBinding(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute attribute, out SafeFreeContextBufferChannelBinding refHandle) @@ -129,7 +129,7 @@ public unsafe int QueryContextAttributes(SafeDeleteContext phContext, Interop.Ss } else { - throw new ArgumentException(System.SRHelper.Format(SR.SSPIInvalidHandleType, handleType.FullName), nameof(handleType)); + throw new ArgumentException(System.StringsHelper.Format(Strings.SSPIInvalidHandleType, handleType.FullName), nameof(handleType)); } } fixed (byte* bufferPtr = buffer) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs index 3e31c0c845..ea8e713529 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs @@ -81,7 +81,7 @@ internal static SecurityPackageInfoClass GetVerifyPackageInfo(SSPIInterface secM if (throwIfMissing) { - throw new NotSupportedException(SR.net_securitypackagesupport); + throw new NotSupportedException(Strings.net_securitypackagesupport); } return null; @@ -101,7 +101,7 @@ public static SafeFreeCredentials AcquireDefaultCredential(SSPIInterface secModu if (errorCode != 0) { if (NetEventSource.IsEnabled) - NetEventSource.Error(null, System.SRHelper.Format(SR.net_log_operation_failed_with_error, nameof(AcquireDefaultCredential), $"0x{errorCode:X}")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.net_log_operation_failed_with_error, nameof(AcquireDefaultCredential), $"0x{errorCode:X}")); throw new Win32Exception(errorCode); } return outCredential; @@ -118,7 +118,7 @@ public static SafeFreeCredentials AcquireCredentialsHandle(SSPIInterface secModu if (errorCode != 0) { if (NetEventSource.IsEnabled) - NetEventSource.Error(null, System.SRHelper.Format(SR.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}")); throw new Win32Exception(errorCode); } @@ -143,7 +143,7 @@ public static SafeFreeCredentials AcquireCredentialsHandle(SSPIInterface secModu if (errorCode != 0) { if (NetEventSource.IsEnabled) - NetEventSource.Error(null, System.SRHelper.Format(SR.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}")); throw new Win32Exception(errorCode); } @@ -295,7 +295,7 @@ private static unsafe int EncryptDecryptHelper(OP op, SSPIInterface secModule, S default: NetEventSource.Fail(null, $"Unknown OP: {op}"); - throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException); + throw NotImplemented.ByDesignWithMessage(Strings.net_MethodNotImplementedException); } // Marshalling back returned sizes / data. @@ -359,11 +359,11 @@ private static unsafe int EncryptDecryptHelper(OP op, SSPIInterface secModule, S { if (errorCode == Interop.SspiCli.SEC_I_RENEGOTIATE) { - NetEventSource.Error(null, System.SRHelper.Format(SR.event_OperationReturnedSomething, op, "SEC_I_RENEGOTIATE")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.event_OperationReturnedSomething, op, "SEC_I_RENEGOTIATE")); } else { - NetEventSource.Error(null, System.SRHelper.Format(SR.net_log_operation_failed_with_error, op, $"0x{0:X}")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.net_log_operation_failed_with_error, op, $"0x{0:X}")); } } @@ -466,7 +466,7 @@ public static object QueryContextAttributes(SSPIInterface secModule, SafeDeleteC break; default: - throw new ArgumentException(System.SRHelper.Format(SR.net_invalid_enum, nameof(contextAttribute)), nameof(contextAttribute)); + throw new ArgumentException(System.StringsHelper.Format(Strings.net_invalid_enum, nameof(contextAttribute)), nameof(contextAttribute)); } SafeHandle sspiHandle = null; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/AdapterUtil.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/AdapterUtil.cs index d98dc914d3..74d812cf5d 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/AdapterUtil.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/AdapterUtil.cs @@ -200,7 +200,7 @@ internal static bool RemoveStringQuotes(string quotePrefix, string quoteSuffix, internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, string value, string method) { - return ArgumentOutOfRange(System.SRHelper.Format(SR.ADP_NotSupportedEnumerationValue, type.Name, value, method), type.Name); + return ArgumentOutOfRange(System.StringsHelper.Format(Strings.ADP_NotSupportedEnumerationValue, type.Name, value, method), type.Name); } internal static InvalidOperationException DataAdapter(string error) @@ -215,21 +215,21 @@ private static InvalidOperationException Provider(string error) internal static ArgumentException InvalidMultipartName(string property, string value) { - ArgumentException e = new ArgumentException(System.SRHelper.Format(SR.ADP_InvalidMultipartName, property, value)); + ArgumentException e = new ArgumentException(System.StringsHelper.Format(Strings.ADP_InvalidMultipartName, property, value)); TraceExceptionAsReturnValue(e); return e; } internal static ArgumentException InvalidMultipartNameIncorrectUsageOfQuotes(string property, string value) { - ArgumentException e = new ArgumentException(System.SRHelper.Format(SR.ADP_InvalidMultipartNameQuoteUsage, property, value)); + ArgumentException e = new ArgumentException(System.StringsHelper.Format(Strings.ADP_InvalidMultipartNameQuoteUsage, property, value)); TraceExceptionAsReturnValue(e); return e; } internal static ArgumentException InvalidMultipartNameToManyParts(string property, string value, int limit) { - ArgumentException e = new ArgumentException(System.SRHelper.Format(SR.ADP_InvalidMultipartNameToManyParts, property, value, limit)); + ArgumentException e = new ArgumentException(System.StringsHelper.Format(Strings.ADP_InvalidMultipartNameToManyParts, property, value, limit)); TraceExceptionAsReturnValue(e); return e; } @@ -286,7 +286,7 @@ internal static bool IsCatchableOrSecurityExceptionType(Exception e) // Invalid Enumeration internal static ArgumentOutOfRangeException InvalidEnumerationValue(Type type, int value) { - return ArgumentOutOfRange(System.SRHelper.Format(SR.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name); + return ArgumentOutOfRange(System.StringsHelper.Format(Strings.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name); } // @@ -294,15 +294,15 @@ internal static ArgumentOutOfRangeException InvalidEnumerationValue(Type type, i // internal static ArgumentException ConnectionStringSyntax(int index) { - return Argument(System.SRHelper.Format(SR.ADP_ConnectionStringSyntax, index)); + return Argument(System.StringsHelper.Format(Strings.ADP_ConnectionStringSyntax, index)); } internal static ArgumentException KeywordNotSupported(string keyword) { - return Argument(System.SRHelper.Format(SR.ADP_KeywordNotSupported, keyword)); + return Argument(System.StringsHelper.Format(Strings.ADP_KeywordNotSupported, keyword)); } internal static ArgumentException ConvertFailed(Type fromType, Type toType, Exception innerException) { - return ADP.Argument(System.SRHelper.Format(SR.SqlConvert_ConvertFailed, fromType.FullName, toType.FullName), innerException); + return ADP.Argument(System.StringsHelper.Format(Strings.SqlConvert_ConvertFailed, fromType.FullName, toType.FullName), innerException); } // @@ -314,11 +314,11 @@ internal static Exception InvalidConnectionOptionValue(string key) } internal static Exception InvalidConnectionOptionValue(string key, Exception inner) { - return Argument(System.SRHelper.Format(SR.ADP_InvalidConnectionOptionValue, key), inner); + return Argument(System.StringsHelper.Format(Strings.ADP_InvalidConnectionOptionValue, key), inner); } static internal InvalidOperationException InvalidDataDirectory() { - InvalidOperationException e = new InvalidOperationException(SR.ADP_InvalidDataDirectory); + InvalidOperationException e = new InvalidOperationException(Strings.ADP_InvalidDataDirectory); return e; } @@ -327,23 +327,23 @@ static internal InvalidOperationException InvalidDataDirectory() // internal static ArgumentException CollectionRemoveInvalidObject(Type itemType, ICollection collection) { - return Argument(System.SRHelper.Format(SR.ADP_CollectionRemoveInvalidObject, itemType.Name, collection.GetType().Name)); + return Argument(System.StringsHelper.Format(Strings.ADP_CollectionRemoveInvalidObject, itemType.Name, collection.GetType().Name)); } internal static ArgumentNullException CollectionNullValue(string parameter, Type collection, Type itemType) { - return ArgumentNull(parameter, System.SRHelper.Format(SR.ADP_CollectionNullValue, collection.Name, itemType.Name)); + return ArgumentNull(parameter, System.StringsHelper.Format(Strings.ADP_CollectionNullValue, collection.Name, itemType.Name)); } internal static IndexOutOfRangeException CollectionIndexInt32(int index, Type collection, int count) { - return IndexOutOfRange(System.SRHelper.Format(SR.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture))); + return IndexOutOfRange(System.StringsHelper.Format(Strings.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture))); } internal static IndexOutOfRangeException CollectionIndexString(Type itemType, string propertyName, string propertyValue, Type collection) { - return IndexOutOfRange(System.SRHelper.Format(SR.ADP_CollectionIndexString, itemType.Name, propertyName, propertyValue, collection.Name)); + return IndexOutOfRange(System.StringsHelper.Format(Strings.ADP_CollectionIndexString, itemType.Name, propertyName, propertyValue, collection.Name)); } internal static InvalidCastException CollectionInvalidType(Type collection, Type itemType, object invalidValue) { - return InvalidCast(System.SRHelper.Format(SR.ADP_CollectionInvalidType, collection.Name, itemType.Name, invalidValue.GetType().Name)); + return InvalidCast(System.StringsHelper.Format(Strings.ADP_CollectionInvalidType, collection.Name, itemType.Name, invalidValue.GetType().Name)); } // @@ -355,17 +355,17 @@ private static string ConnectionStateMsg(ConnectionState state) { case (ConnectionState.Closed): case (ConnectionState.Connecting | ConnectionState.Broken): // treated the same as closed - return SR.ADP_ConnectionStateMsg_Closed; + return Strings.ADP_ConnectionStateMsg_Closed; case (ConnectionState.Connecting): - return SR.ADP_ConnectionStateMsg_Connecting; + return Strings.ADP_ConnectionStateMsg_Connecting; case (ConnectionState.Open): - return SR.ADP_ConnectionStateMsg_Open; + return Strings.ADP_ConnectionStateMsg_Open; case (ConnectionState.Open | ConnectionState.Executing): - return SR.ADP_ConnectionStateMsg_OpenExecuting; + return Strings.ADP_ConnectionStateMsg_OpenExecuting; case (ConnectionState.Open | ConnectionState.Fetching): - return SR.ADP_ConnectionStateMsg_OpenFetching; + return Strings.ADP_ConnectionStateMsg_OpenFetching; default: - return System.SRHelper.Format(SR.ADP_ConnectionStateMsg, state.ToString()); + return System.StringsHelper.Format(Strings.ADP_ConnectionStateMsg, state.ToString()); } } @@ -374,7 +374,7 @@ private static string ConnectionStateMsg(ConnectionState state) // internal static Exception StreamClosed([CallerMemberName] string method = "") { - return InvalidOperation(System.SRHelper.Format(SR.ADP_StreamClosed, method)); + return InvalidOperation(System.StringsHelper.Format(Strings.ADP_StreamClosed, method)); } internal static string BuildQuotedString(string quotePrefix, string quoteSuffix, string unQuotedString) @@ -424,11 +424,11 @@ static internal string BuildMultiPartName(string[] strings) // internal static ArgumentException ParametersIsNotParent(Type parameterType, ICollection collection) { - return Argument(System.SRHelper.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); + return Argument(System.StringsHelper.Format(Strings.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); } internal static ArgumentException ParametersIsParent(Type parameterType, ICollection collection) { - return Argument(System.SRHelper.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); + return Argument(System.StringsHelper.Format(Strings.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); } @@ -474,7 +474,7 @@ internal enum InternalErrorCode internal static Exception InternalError(InternalErrorCode internalError) { - return InvalidOperation(System.SRHelper.Format(SR.ADP_InternalProviderError, (int)internalError)); + return InvalidOperation(System.StringsHelper.Format(Strings.ADP_InternalProviderError, (int)internalError)); } // @@ -482,23 +482,23 @@ internal static Exception InternalError(InternalErrorCode internalError) // internal static Exception DataReaderClosed([CallerMemberName] string method = "") { - return InvalidOperation(System.SRHelper.Format(SR.ADP_DataReaderClosed, method)); + return InvalidOperation(System.StringsHelper.Format(Strings.ADP_DataReaderClosed, method)); } internal static ArgumentOutOfRangeException InvalidSourceBufferIndex(int maxLen, long srcOffset, string parameterName) { - return ArgumentOutOfRange(System.SRHelper.Format(SR.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName); + return ArgumentOutOfRange(System.StringsHelper.Format(Strings.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName); } internal static ArgumentOutOfRangeException InvalidDestinationBufferIndex(int maxLen, int dstOffset, string parameterName) { - return ArgumentOutOfRange(System.SRHelper.Format(SR.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName); + return ArgumentOutOfRange(System.StringsHelper.Format(Strings.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName); } internal static IndexOutOfRangeException InvalidBufferSizeOrIndex(int numBytes, int bufferIndex) { - return IndexOutOfRange(System.SRHelper.Format(SR.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture))); + return IndexOutOfRange(System.StringsHelper.Format(Strings.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture))); } internal static Exception InvalidDataLength(long length) { - return IndexOutOfRange(System.SRHelper.Format(SR.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture))); + return IndexOutOfRange(System.StringsHelper.Format(Strings.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture))); } internal static bool CompareInsensitiveInvariant(string strvalue, string strconst) => @@ -520,7 +520,7 @@ internal static bool IsNull(object value) internal static Exception InvalidSeekOrigin(string parameterName) { - return ArgumentOutOfRange(SR.ADP_InvalidSeekOrigin, parameterName); + return ArgumentOutOfRange(Strings.ADP_InvalidSeekOrigin, parameterName); } internal static void SetCurrentTransaction(Transaction transaction) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/SQLResource.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/SQLResource.cs index 0647326e69..9d4a0818cb 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/SQLResource.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/SQLResource.cs @@ -8,64 +8,64 @@ namespace Microsoft.Data.SqlTypes { internal static class SQLResource { - internal static string NullString => SR.SqlMisc_NullString; + internal static string NullString => Strings.SqlMisc_NullString; - internal static string MessageString => SR.SqlMisc_MessageString; + internal static string MessageString => Strings.SqlMisc_MessageString; - internal static string ArithOverflowMessage => SR.SqlMisc_ArithOverflowMessage; + internal static string ArithOverflowMessage => Strings.SqlMisc_ArithOverflowMessage; - internal static string DivideByZeroMessage => SR.SqlMisc_DivideByZeroMessage; + internal static string DivideByZeroMessage => Strings.SqlMisc_DivideByZeroMessage; - internal static string NullValueMessage => SR.SqlMisc_NullValueMessage; + internal static string NullValueMessage => Strings.SqlMisc_NullValueMessage; - internal static string TruncationMessage => SR.SqlMisc_TruncationMessage; + internal static string TruncationMessage => Strings.SqlMisc_TruncationMessage; - internal static string DateTimeOverflowMessage => SR.SqlMisc_DateTimeOverflowMessage; + internal static string DateTimeOverflowMessage => Strings.SqlMisc_DateTimeOverflowMessage; - internal static string ConcatDiffCollationMessage => SR.SqlMisc_ConcatDiffCollationMessage; + internal static string ConcatDiffCollationMessage => Strings.SqlMisc_ConcatDiffCollationMessage; - internal static string CompareDiffCollationMessage => SR.SqlMisc_CompareDiffCollationMessage; + internal static string CompareDiffCollationMessage => Strings.SqlMisc_CompareDiffCollationMessage; - internal static string InvalidFlagMessage => SR.SqlMisc_InvalidFlagMessage; + internal static string InvalidFlagMessage => Strings.SqlMisc_InvalidFlagMessage; - internal static string NumeToDecOverflowMessage => SR.SqlMisc_NumeToDecOverflowMessage; + internal static string NumeToDecOverflowMessage => Strings.SqlMisc_NumeToDecOverflowMessage; - internal static string ConversionOverflowMessage => SR.SqlMisc_ConversionOverflowMessage; + internal static string ConversionOverflowMessage => Strings.SqlMisc_ConversionOverflowMessage; - internal static string InvalidDateTimeMessage => SR.SqlMisc_InvalidDateTimeMessage; + internal static string InvalidDateTimeMessage => Strings.SqlMisc_InvalidDateTimeMessage; - internal static string TimeZoneSpecifiedMessage => SR.SqlMisc_TimeZoneSpecifiedMessage; + internal static string TimeZoneSpecifiedMessage => Strings.SqlMisc_TimeZoneSpecifiedMessage; - internal static string InvalidArraySizeMessage => SR.SqlMisc_InvalidArraySizeMessage; + internal static string InvalidArraySizeMessage => Strings.SqlMisc_InvalidArraySizeMessage; - internal static string InvalidPrecScaleMessage => SR.SqlMisc_InvalidPrecScaleMessage; + internal static string InvalidPrecScaleMessage => Strings.SqlMisc_InvalidPrecScaleMessage; - internal static string FormatMessage => SR.SqlMisc_FormatMessage; + internal static string FormatMessage => Strings.SqlMisc_FormatMessage; - internal static string NotFilledMessage => SR.SqlMisc_NotFilledMessage; + internal static string NotFilledMessage => Strings.SqlMisc_NotFilledMessage; - internal static string AlreadyFilledMessage => SR.SqlMisc_AlreadyFilledMessage; + internal static string AlreadyFilledMessage => Strings.SqlMisc_AlreadyFilledMessage; - internal static string ClosedXmlReaderMessage => SR.SqlMisc_ClosedXmlReaderMessage; + internal static string ClosedXmlReaderMessage => Strings.SqlMisc_ClosedXmlReaderMessage; internal static string InvalidOpStreamClosed(string method) { - return System.SRHelper.Format(SR.SqlMisc_InvalidOpStreamClosed, method); + return System.StringsHelper.Format(Strings.SqlMisc_InvalidOpStreamClosed, method); } internal static string InvalidOpStreamNonWritable(string method) { - return System.SRHelper.Format(SR.SqlMisc_InvalidOpStreamNonWritable, method); + return System.StringsHelper.Format(Strings.SqlMisc_InvalidOpStreamNonWritable, method); } internal static string InvalidOpStreamNonReadable(string method) { - return System.SRHelper.Format(SR.SqlMisc_InvalidOpStreamNonReadable, method); + return System.StringsHelper.Format(Strings.SqlMisc_InvalidOpStreamNonReadable, method); } internal static string InvalidOpStreamNonSeekable(string method) { - return System.SRHelper.Format(SR.SqlMisc_InvalidOpStreamNonSeekable, method); + return System.StringsHelper.Format(Strings.SqlMisc_InvalidOpStreamNonSeekable, method); } } // SqlResource } // namespace System diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs index 74ed1b5d61..a759af1db0 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs @@ -28,7 +28,7 @@ internal static partial class NegotiateStreamPal internal static string QueryContextClientSpecifiedSpn(SafeDeleteContext securityContext) { - throw new PlatformNotSupportedException(SR.net_nego_server_not_supported); + throw new PlatformNotSupportedException(Strings.net_nego_server_not_supported); } internal static string QueryContextAuthenticationPackage(SafeDeleteContext securityContext) @@ -227,14 +227,14 @@ internal static string QueryContextAuthenticationPackage(SafeDeleteContext secur // TODO (Issue #3718): The second buffer can contain a channel binding which is not supported if ((null != inSecurityBufferArray) && (inSecurityBufferArray.Length > 1)) { - throw new PlatformNotSupportedException(SR.net_nego_channel_binding_not_supported); + throw new PlatformNotSupportedException(Strings.net_nego_channel_binding_not_supported); } SafeFreeNegoCredentials negoCredentialsHandle = (SafeFreeNegoCredentials)credentialsHandle; if (negoCredentialsHandle.IsDefault && string.IsNullOrEmpty(spn)) { - throw new PlatformNotSupportedException(SR.net_nego_not_supported_empty_target_with_defaultcreds); + throw new PlatformNotSupportedException(Strings.net_nego_not_supported_empty_target_with_defaultcreds); } SecurityStatusPal status = EstablishSecurityContext( @@ -252,7 +252,7 @@ internal static string QueryContextAuthenticationPackage(SafeDeleteContext secur ContextFlagsPal mask = ContextFlagsPal.Confidentiality; if ((requestedContextFlags & mask) != (contextFlags & mask)) { - throw new PlatformNotSupportedException(SR.net_nego_protection_level_not_supported); + throw new PlatformNotSupportedException(Strings.net_nego_protection_level_not_supported); } } @@ -267,7 +267,7 @@ internal static string QueryContextAuthenticationPackage(SafeDeleteContext secur SecurityBuffer outSecurityBuffer, ref ContextFlagsPal contextFlags) { - throw new PlatformNotSupportedException(SR.net_nego_server_not_supported); + throw new PlatformNotSupportedException(Strings.net_nego_server_not_supported); } internal static Win32Exception CreateExceptionFromError(SecurityStatusPal statusCode) @@ -290,7 +290,7 @@ internal static SafeFreeCredentials AcquireCredentialsHandle(string package, boo { if (isServer) { - throw new PlatformNotSupportedException(SR.net_nego_server_not_supported); + throw new PlatformNotSupportedException(Strings.net_nego_server_not_supported); } bool isEmptyCredential = string.IsNullOrWhiteSpace(credential.UserName) || @@ -299,7 +299,7 @@ internal static SafeFreeCredentials AcquireCredentialsHandle(string package, boo if (ntlmOnly && isEmptyCredential) { // NTLM authentication is not possible with default credentials which are no-op - throw new PlatformNotSupportedException(SR.net_ntlm_not_possible_default_cred); + throw new PlatformNotSupportedException(Strings.net_ntlm_not_possible_default_cred); } try diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs index 961086a6fe..58bf635657 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs @@ -40,7 +40,7 @@ internal static unsafe SafeFreeCredentials AcquireCredentialsHandle(string packa if (result != Interop.SECURITY_STATUS.OK) { if (NetEventSource.IsEnabled) - NetEventSource.Error(null, System.SRHelper.Format(SR.net_log_operation_failed_with_error, nameof(Interop.SspiCli.SspiEncodeStringsAsAuthIdentity), $"0x{(int)result:X}")); + NetEventSource.Error(null, System.StringsHelper.Format(Strings.net_log_operation_failed_with_error, nameof(Interop.SspiCli.SspiEncodeStringsAsAuthIdentity), $"0x{(int)result:X}")); throw new Win32Exception((int)result); } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index 7d6f362461..9232078830 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -2,7 +2,7 @@ Microsoft.Data.SqlClient netcoreapp2.1;netcoreapp3.1;netstandard2.0 - SR.PlatformNotSupported_DataSqlClient + Strings.PlatformNotSupported_DataSqlClient $(OS) true true @@ -710,12 +710,12 @@ - + True True - SR.resx + Strings.resx - + @@ -744,9 +744,9 @@ - + ResXFileCodeGenerator - SR.Designer.cs + Strings.Designer.cs System diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/AdapterUtil.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/AdapterUtil.SqlClient.cs index 9f891ff04c..2c66613ca0 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/AdapterUtil.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/AdapterUtil.SqlClient.cs @@ -74,7 +74,7 @@ internal static TypeLoadException TypeLoad(string error) } internal static PlatformNotSupportedException DbTypeNotSupported(string dbType) { - PlatformNotSupportedException e = new PlatformNotSupportedException(System.SRHelper.GetString(SR.SQL_DbTypeNotSupportedOnThisPlatform, dbType)); + PlatformNotSupportedException e = new PlatformNotSupportedException(System.StringsHelper.GetString(Strings.SQL_DbTypeNotSupportedOnThisPlatform, dbType)); return e; } internal static InvalidCastException InvalidCast() @@ -100,12 +100,12 @@ internal static ObjectDisposedException ObjectDisposed(object instance) internal static Exception DataTableDoesNotExist(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_DataTableDoesNotExist, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_DataTableDoesNotExist, collectionName)); } internal static InvalidOperationException MethodCalledTwice(string method) { - InvalidOperationException e = new InvalidOperationException(System.SRHelper.GetString(SR.ADP_CalledTwice, method)); + InvalidOperationException e = new InvalidOperationException(System.StringsHelper.GetString(Strings.ADP_CalledTwice, method)); return e; } @@ -166,7 +166,7 @@ internal static ArgumentOutOfRangeException InvalidParameterDirection(ParameterD internal static Exception TooManyRestrictions(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_TooManyRestrictions, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_TooManyRestrictions, collectionName)); } @@ -192,7 +192,7 @@ internal static ArgumentOutOfRangeException InvalidUpdateRowSource(UpdateRowSour // internal static ArgumentException InvalidMinMaxPoolSizeValues() { - return ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidMinMaxPoolSizeValues)); + return ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidMinMaxPoolSizeValues)); } @@ -201,7 +201,7 @@ internal static ArgumentException InvalidMinMaxPoolSizeValues() // internal static InvalidOperationException NoConnectionString() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_NoConnectionString)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_NoConnectionString)); } internal static Exception MethodNotImplemented([CallerMemberName] string methodName = "") @@ -211,7 +211,7 @@ internal static Exception MethodNotImplemented([CallerMemberName] string methodN internal static Exception QueryFailed(string collectionName, Exception e) { - return InvalidOperation(System.SRHelper.GetString(SR.MDF_QueryFailed, collectionName), e); + return InvalidOperation(System.StringsHelper.GetString(Strings.MDF_QueryFailed, collectionName), e); } @@ -220,11 +220,11 @@ internal static Exception QueryFailed(string collectionName, Exception e) // internal static Exception InvalidConnectionOptionValueLength(string key, int limit) { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidConnectionOptionValueLength, key, limit)); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidConnectionOptionValueLength, key, limit)); } internal static Exception MissingConnectionOptionValue(string key, string requiredAdditionalKey) { - return Argument(System.SRHelper.GetString(SR.ADP_MissingConnectionOptionValue, key, requiredAdditionalKey)); + return Argument(System.StringsHelper.GetString(Strings.ADP_MissingConnectionOptionValue, key, requiredAdditionalKey)); } @@ -233,12 +233,12 @@ internal static Exception MissingConnectionOptionValue(string key, string requir // internal static Exception PooledOpenTimeout() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.ADP_PooledOpenTimeout)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.ADP_PooledOpenTimeout)); } internal static Exception NonPooledOpenTimeout() { - return ADP.TimeoutException(System.SRHelper.GetString(SR.ADP_NonPooledOpenTimeout)); + return ADP.TimeoutException(System.StringsHelper.GetString(Strings.ADP_NonPooledOpenTimeout)); } // @@ -246,31 +246,31 @@ internal static Exception NonPooledOpenTimeout() // internal static InvalidOperationException TransactionConnectionMismatch() { - return Provider(System.SRHelper.GetString(SR.ADP_TransactionConnectionMismatch)); + return Provider(System.StringsHelper.GetString(Strings.ADP_TransactionConnectionMismatch)); } internal static InvalidOperationException TransactionRequired(string method) { - return Provider(System.SRHelper.GetString(SR.ADP_TransactionRequired, method)); + return Provider(System.StringsHelper.GetString(Strings.ADP_TransactionRequired, method)); } internal static Exception CommandTextRequired(string method) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_CommandTextRequired, method)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_CommandTextRequired, method)); } internal static Exception NoColumns() { - return Argument(System.SRHelper.GetString(SR.MDF_NoColumns)); + return Argument(System.StringsHelper.GetString(Strings.MDF_NoColumns)); } internal static InvalidOperationException ConnectionRequired(string method) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_ConnectionRequired, method)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_ConnectionRequired, method)); } internal static InvalidOperationException OpenConnectionRequired(string method, ConnectionState state) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_OpenConnectionRequired, method, ADP.ConnectionStateMsg(state))); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_OpenConnectionRequired, method, ADP.ConnectionStateMsg(state))); } internal static Exception OpenReaderExists(bool marsOn) @@ -280,7 +280,7 @@ internal static Exception OpenReaderExists(bool marsOn) internal static Exception OpenReaderExists(Exception e, bool marsOn) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_OpenReaderExists, marsOn ? ADP.Command : ADP.Connection), e); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_OpenReaderExists, marsOn ? ADP.Command : ADP.Connection), e); } @@ -289,22 +289,22 @@ internal static Exception OpenReaderExists(Exception e, bool marsOn) // internal static Exception NonSeqByteAccess(long badIndex, long currIndex, string method) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_NonSeqByteAccess, badIndex.ToString(CultureInfo.InvariantCulture), currIndex.ToString(CultureInfo.InvariantCulture), method)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_NonSeqByteAccess, badIndex.ToString(CultureInfo.InvariantCulture), currIndex.ToString(CultureInfo.InvariantCulture), method)); } internal static Exception InvalidXml() { - return Argument(System.SRHelper.GetString(SR.MDF_InvalidXml)); + return Argument(System.StringsHelper.GetString(Strings.MDF_InvalidXml)); } internal static Exception NegativeParameter(string parameterName) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_NegativeParameter, parameterName)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_NegativeParameter, parameterName)); } internal static Exception InvalidXmlMissingColumn(string collectionName, string columnName) { - return Argument(System.SRHelper.GetString(SR.MDF_InvalidXmlMissingColumn, collectionName, columnName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_InvalidXmlMissingColumn, collectionName, columnName)); } // @@ -312,22 +312,22 @@ internal static Exception InvalidXmlMissingColumn(string collectionName, string // internal static Exception InvalidMetaDataValue() { - return ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidMetaDataValue)); + return ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidMetaDataValue)); } internal static InvalidOperationException NonSequentialColumnAccess(int badCol, int currCol) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_NonSequentialColumnAccess, badCol.ToString(CultureInfo.InvariantCulture), currCol.ToString(CultureInfo.InvariantCulture))); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_NonSequentialColumnAccess, badCol.ToString(CultureInfo.InvariantCulture), currCol.ToString(CultureInfo.InvariantCulture))); } internal static Exception InvalidXmlInvalidValue(string collectionName, string columnName) { - return Argument(System.SRHelper.GetString(SR.MDF_InvalidXmlInvalidValue, collectionName, columnName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_InvalidXmlInvalidValue, collectionName, columnName)); } internal static Exception CollectionNameIsNotUnique(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_CollectionNameISNotUnique, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_CollectionNameISNotUnique, collectionName)); } @@ -336,60 +336,60 @@ internal static Exception CollectionNameIsNotUnique(string collectionName) // internal static Exception InvalidCommandTimeout(int value, [CallerMemberName] string property = "") { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidCommandTimeout, value.ToString(CultureInfo.InvariantCulture)), property); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidCommandTimeout, value.ToString(CultureInfo.InvariantCulture)), property); } internal static Exception UninitializedParameterSize(int index, Type dataType) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_UninitializedParameterSize, index.ToString(CultureInfo.InvariantCulture), dataType.Name)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_UninitializedParameterSize, index.ToString(CultureInfo.InvariantCulture), dataType.Name)); } internal static Exception UnableToBuildCollection(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_UnableToBuildCollection, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_UnableToBuildCollection, collectionName)); } internal static Exception PrepareParameterType(DbCommand cmd) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_PrepareParameterType, cmd.GetType().Name)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_PrepareParameterType, cmd.GetType().Name)); } internal static Exception UndefinedCollection(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_UndefinedCollection, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_UndefinedCollection, collectionName)); } internal static Exception UnsupportedVersion(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_UnsupportedVersion, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_UnsupportedVersion, collectionName)); } internal static Exception AmbiguousCollectionName(string collectionName) { - return Argument(System.SRHelper.GetString(SR.MDF_AmbiguousCollectionName, collectionName)); + return Argument(System.StringsHelper.GetString(Strings.MDF_AmbiguousCollectionName, collectionName)); } internal static Exception PrepareParameterSize(DbCommand cmd) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_PrepareParameterSize, cmd.GetType().Name)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_PrepareParameterSize, cmd.GetType().Name)); } internal static Exception PrepareParameterScale(DbCommand cmd, string type) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_PrepareParameterScale, cmd.GetType().Name, type)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_PrepareParameterScale, cmd.GetType().Name, type)); } internal static Exception MissingDataSourceInformationColumn() { - return Argument(System.SRHelper.GetString(SR.MDF_MissingDataSourceInformationColumn)); + return Argument(System.StringsHelper.GetString(Strings.MDF_MissingDataSourceInformationColumn)); } internal static Exception IncorrectNumberOfDataSourceInformationRows() { - return Argument(System.SRHelper.GetString(SR.MDF_IncorrectNumberOfDataSourceInformationRows)); + return Argument(System.StringsHelper.GetString(Strings.MDF_IncorrectNumberOfDataSourceInformationRows)); } internal static Exception MismatchedAsyncResult(string expectedMethod, string gotMethod) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_MismatchedAsyncResult, expectedMethod, gotMethod)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_MismatchedAsyncResult, expectedMethod, gotMethod)); } // @@ -397,27 +397,27 @@ internal static Exception MismatchedAsyncResult(string expectedMethod, string go // internal static Exception ClosedConnectionError() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_ClosedConnectionError)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_ClosedConnectionError)); } internal static Exception ConnectionAlreadyOpen(ConnectionState state) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_ConnectionAlreadyOpen, ADP.ConnectionStateMsg(state))); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_ConnectionAlreadyOpen, ADP.ConnectionStateMsg(state))); } internal static Exception TransactionPresent() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_TransactionPresent)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_TransactionPresent)); } internal static Exception LocalTransactionPresent() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_LocalTransactionPresent)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_LocalTransactionPresent)); } internal static Exception OpenConnectionPropertySet(string property, ConnectionState state) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_OpenConnectionPropertySet, property, ADP.ConnectionStateMsg(state))); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_OpenConnectionPropertySet, property, ADP.ConnectionStateMsg(state))); } internal static Exception EmptyDatabaseName() { - return Argument(System.SRHelper.GetString(SR.ADP_EmptyDatabaseName)); + return Argument(System.StringsHelper.GetString(Strings.ADP_EmptyDatabaseName)); } internal enum ConnectionError @@ -430,27 +430,27 @@ internal enum ConnectionError internal static Exception MissingRestrictionColumn() { - return Argument(System.SRHelper.GetString(SR.MDF_MissingRestrictionColumn)); + return Argument(System.StringsHelper.GetString(Strings.MDF_MissingRestrictionColumn)); } internal static Exception InternalConnectionError(ConnectionError internalError) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_InternalConnectionError, (int)internalError)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InternalConnectionError, (int)internalError)); } internal static Exception InvalidConnectRetryCountValue() { - return Argument(System.SRHelper.GetString(SR.SQLCR_InvalidConnectRetryCountValue)); + return Argument(System.StringsHelper.GetString(Strings.SQLCR_InvalidConnectRetryCountValue)); } internal static Exception MissingRestrictionRow() { - return Argument(System.SRHelper.GetString(SR.MDF_MissingRestrictionRow)); + return Argument(System.StringsHelper.GetString(Strings.MDF_MissingRestrictionRow)); } internal static Exception InvalidConnectRetryIntervalValue() { - return Argument(System.SRHelper.GetString(SR.SQLCR_InvalidConnectRetryIntervalValue)); + return Argument(System.StringsHelper.GetString(Strings.SQLCR_InvalidConnectRetryIntervalValue)); } // @@ -458,7 +458,7 @@ internal static Exception InvalidConnectRetryIntervalValue() // internal static InvalidOperationException AsyncOperationPending() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_PendingAsyncOperation)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_PendingAsyncOperation)); } // @@ -466,50 +466,50 @@ internal static InvalidOperationException AsyncOperationPending() // internal static IOException ErrorReadingFromStream(Exception internalException) { - return IO(System.SRHelper.GetString(SR.SqlMisc_StreamErrorMessage), internalException); + return IO(System.StringsHelper.GetString(Strings.SqlMisc_StreamErrorMessage), internalException); } internal static ArgumentException InvalidDataType(TypeCode typecode) { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidDataType, typecode.ToString())); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataType, typecode.ToString())); } internal static ArgumentException UnknownDataType(Type dataType) { - return Argument(System.SRHelper.GetString(SR.ADP_UnknownDataType, dataType.FullName)); + return Argument(System.StringsHelper.GetString(Strings.ADP_UnknownDataType, dataType.FullName)); } internal static ArgumentException DbTypeNotSupported(DbType type, Type enumtype) { - return Argument(System.SRHelper.GetString(SR.ADP_DbTypeNotSupported, type.ToString(), enumtype.Name)); + return Argument(System.StringsHelper.GetString(Strings.ADP_DbTypeNotSupported, type.ToString(), enumtype.Name)); } internal static ArgumentException UnknownDataTypeCode(Type dataType, TypeCode typeCode) { - return Argument(System.SRHelper.GetString(SR.ADP_UnknownDataTypeCode, ((int)typeCode).ToString(CultureInfo.InvariantCulture), dataType.FullName)); + return Argument(System.StringsHelper.GetString(Strings.ADP_UnknownDataTypeCode, ((int)typeCode).ToString(CultureInfo.InvariantCulture), dataType.FullName)); } internal static ArgumentException InvalidOffsetValue(int value) { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidOffsetValue, value.ToString(CultureInfo.InvariantCulture))); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidOffsetValue, value.ToString(CultureInfo.InvariantCulture))); } internal static ArgumentException InvalidSizeValue(int value) { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidSizeValue, value.ToString(CultureInfo.InvariantCulture))); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidSizeValue, value.ToString(CultureInfo.InvariantCulture))); } internal static ArgumentException ParameterValueOutOfRange(decimal value) { - return ADP.Argument(System.SRHelper.GetString(SR.ADP_ParameterValueOutOfRange, value.ToString((IFormatProvider)null))); + return ADP.Argument(System.StringsHelper.GetString(Strings.ADP_ParameterValueOutOfRange, value.ToString((IFormatProvider)null))); } internal static ArgumentException ParameterValueOutOfRange(SqlDecimal value) { - return ADP.Argument(System.SRHelper.GetString(SR.ADP_ParameterValueOutOfRange, value.ToString())); + return ADP.Argument(System.StringsHelper.GetString(Strings.ADP_ParameterValueOutOfRange, value.ToString())); } internal static ArgumentException ParameterValueOutOfRange(String value) { - return ADP.Argument(System.SRHelper.GetString(SR.ADP_ParameterValueOutOfRange, value)); + return ADP.Argument(System.StringsHelper.GetString(Strings.ADP_ParameterValueOutOfRange, value)); } internal static ArgumentException VersionDoesNotSupportDataType(string typeName) { - return Argument(System.SRHelper.GetString(SR.ADP_VersionDoesNotSupportDataType, typeName)); + return Argument(System.StringsHelper.GetString(Strings.ADP_VersionDoesNotSupportDataType, typeName)); } internal static Exception ParameterConversionFailed(object value, Type destType, Exception inner) { @@ -517,7 +517,7 @@ internal static Exception ParameterConversionFailed(object value, Type destType, Debug.Assert(null != inner, "null inner on conversion failure"); Exception e; - string message = System.SRHelper.GetString(SR.ADP_ParameterConversionFailed, value.GetType().Name, destType.Name); + string message = System.StringsHelper.GetString(Strings.ADP_ParameterConversionFailed, value.GetType().Name, destType.Name); if (inner is ArgumentException) { e = new ArgumentException(message, inner); @@ -572,11 +572,11 @@ internal static Exception InvalidParameterType(DbParameterCollection collection, // internal static Exception ParallelTransactionsNotSupported(DbConnection obj) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_ParallelTransactionsNotSupported, obj.GetType().Name)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_ParallelTransactionsNotSupported, obj.GetType().Name)); } internal static Exception TransactionZombied(DbTransaction obj) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_TransactionZombied, obj.GetType().Name)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_TransactionZombied, obj.GetType().Name)); } // global constant strings @@ -754,10 +754,10 @@ internal static Version GetAssemblyVersion() } - internal static readonly string[] AzureSqlServerEndpoints = {System.SRHelper.GetString(SR.AZURESQL_GenericEndpoint), - System.SRHelper.GetString(SR.AZURESQL_GermanEndpoint), - System.SRHelper.GetString(SR.AZURESQL_UsGovEndpoint), - System.SRHelper.GetString(SR.AZURESQL_ChinaEndpoint)}; + internal static readonly string[] AzureSqlServerEndpoints = {System.StringsHelper.GetString(Strings.AZURESQL_GenericEndpoint), + System.StringsHelper.GetString(Strings.AZURESQL_GermanEndpoint), + System.StringsHelper.GetString(Strings.AZURESQL_UsGovEndpoint), + System.StringsHelper.GetString(Strings.AZURESQL_ChinaEndpoint)}; // This method assumes dataSource parameter is in TCP connection string format. internal static bool IsAzureSqlServerEndpoint(string dataSource) @@ -809,21 +809,21 @@ internal static ArgumentOutOfRangeException InvalidDataRowVersion(DataRowVersion internal static ArgumentException SingleValuedProperty(string propertyName, string value) { - ArgumentException e = new ArgumentException(System.SRHelper.GetString(SR.ADP_SingleValuedProperty, propertyName, value)); + ArgumentException e = new ArgumentException(System.StringsHelper.GetString(Strings.ADP_SingleValuedProperty, propertyName, value)); TraceExceptionAsReturnValue(e); return e; } internal static ArgumentException DoubleValuedProperty(string propertyName, string value1, string value2) { - ArgumentException e = new ArgumentException(System.SRHelper.GetString(SR.ADP_DoubleValuedProperty, propertyName, value1, value2)); + ArgumentException e = new ArgumentException(System.StringsHelper.GetString(Strings.ADP_DoubleValuedProperty, propertyName, value1, value2)); TraceExceptionAsReturnValue(e); return e; } internal static ArgumentException InvalidPrefixSuffix() { - ArgumentException e = new ArgumentException(System.SRHelper.GetString(SR.ADP_InvalidPrefixSuffix)); + ArgumentException e = new ArgumentException(System.StringsHelper.GetString(Strings.ADP_InvalidPrefixSuffix)); TraceExceptionAsReturnValue(e); return e; } @@ -850,19 +850,19 @@ internal static ArgumentOutOfRangeException NotSupportedCommandBehavior(CommandB internal static ArgumentException BadParameterName(string parameterName) { - ArgumentException e = new ArgumentException(System.SRHelper.GetString(SR.ADP_BadParameterName, parameterName)); + ArgumentException e = new ArgumentException(System.StringsHelper.GetString(Strings.ADP_BadParameterName, parameterName)); TraceExceptionAsReturnValue(e); return e; } internal static Exception DeriveParametersNotSupported(IDbCommand value) { - return DataAdapter(System.SRHelper.GetString(SR.ADP_DeriveParametersNotSupported, value.GetType().Name, value.CommandType.ToString())); + return DataAdapter(System.StringsHelper.GetString(Strings.ADP_DeriveParametersNotSupported, value.GetType().Name, value.CommandType.ToString())); } internal static Exception NoStoredProcedureExists(string sproc) { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_NoStoredProcedureExists, sproc)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_NoStoredProcedureExists, sproc)); } // @@ -870,7 +870,7 @@ internal static Exception NoStoredProcedureExists(string sproc) // internal static InvalidOperationException TransactionCompletedButNotDisposed() { - return Provider(System.SRHelper.GetString(SR.ADP_TransactionCompletedButNotDisposed)); + return Provider(System.StringsHelper.GetString(Strings.ADP_TransactionCompletedButNotDisposed)); } internal static ArgumentOutOfRangeException InvalidUserDefinedTypeSerializationFormat(Microsoft.Data.SqlClient.Server.Format value) @@ -892,50 +892,50 @@ internal static ArgumentOutOfRangeException ArgumentOutOfRange(string message, s internal static ArgumentException InvalidArgumentLength(string argumentName, int limit) { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidArgumentLength, argumentName, limit)); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidArgumentLength, argumentName, limit)); } internal static ArgumentException MustBeReadOnly(string argumentName) { - return Argument(System.SRHelper.GetString(SR.ADP_MustBeReadOnly, argumentName)); + return Argument(System.StringsHelper.GetString(Strings.ADP_MustBeReadOnly, argumentName)); } internal static InvalidOperationException InvalidMixedUsageOfSecureAndClearCredential() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfSecureAndClearCredential)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfSecureAndClearCredential)); } internal static ArgumentException InvalidMixedArgumentOfSecureAndClearCredential() { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfSecureAndClearCredential)); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfSecureAndClearCredential)); } internal static InvalidOperationException InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity() { - return InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity)); + return InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity)); } internal static ArgumentException InvalidMixedArgumentOfSecureCredentialAndIntegratedSecurity() { - return Argument(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity)); + return Argument(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity)); } internal static InvalidOperationException InvalidMixedUsageOfAccessTokenAndIntegratedSecurity() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfAccessTokenAndIntegratedSecurity)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfAccessTokenAndIntegratedSecurity)); } static internal InvalidOperationException InvalidMixedUsageOfAccessTokenAndUserIDPassword() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfAccessTokenAndUserIDPassword)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfAccessTokenAndUserIDPassword)); } static internal InvalidOperationException InvalidMixedUsageOfAccessTokenAndAuthentication() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfAccessTokenAndAuthentication)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfAccessTokenAndAuthentication)); } static internal Exception InvalidMixedUsageOfCredentialAndAccessToken() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.ADP_InvalidMixedUsageOfCredentialAndAccessToken)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.ADP_InvalidMixedUsageOfCredentialAndAccessToken)); } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/DataException.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/DataException.cs index 905e3b8de5..e7613a4616 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/DataException.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/DataException.cs @@ -52,7 +52,7 @@ internal static ArgumentException _Argument(string error) } public static Exception InvalidOffsetLength() { - return _Argument(SRHelper.GetString(SR.Data_InvalidOffsetLength)); + return _Argument(StringsHelper.GetString(Strings.Data_InvalidOffsetLength)); } }// ExceptionBuilder } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/OperationAbortedException.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/OperationAbortedException.cs index cea0c3f747..ea94e5405b 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/OperationAbortedException.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/OperationAbortedException.cs @@ -26,11 +26,11 @@ internal static OperationAbortedException Aborted(Exception inner) OperationAbortedException e; if (inner == null) { - e = new OperationAbortedException(SR.ADP_OperationAborted, null); + e = new OperationAbortedException(Strings.ADP_OperationAborted, null); } else { - e = new OperationAbortedException(SR.ADP_OperationAbortedExceptionMessage, inner); + e = new OperationAbortedException(Strings.ADP_OperationAbortedExceptionMessage, inner); } return e; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.NetCoreApp.cs index 4a461b0532..b41ef407bf 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.NetCoreApp.cs @@ -111,7 +111,7 @@ internal override void CreateEnclaveSession(byte[] attestationInfo, ECDiffieHell } else { - throw new AlwaysEncryptedAttestationException(SR.FailToCreateEnclaveSession); + throw new AlwaysEncryptedAttestationException(Strings.FailToCreateEnclaveSession); } } } @@ -215,7 +215,7 @@ public AzureAttestationInfo(byte[] attestationInfo) } catch (Exception exception) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.FailToParseAttestationInfo, exception.Message)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.FailToParseAttestationInfo, exception.Message)); } } } @@ -277,7 +277,7 @@ internal byte[] PrepareAttestationParameters(string attestationUrl, byte[] attes } else { - throw new AlwaysEncryptedAttestationException(SR.FailToCreateEnclaveSession); + throw new AlwaysEncryptedAttestationException(Strings.FailToCreateEnclaveSession); } } @@ -313,7 +313,7 @@ private void VerifyAzureAttestationInfo(string attestationUrl, EnclaveType encla if (!isSignatureValid) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.AttestationTokenSignatureValidationFailed, exceptionMessage)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.AttestationTokenSignatureValidationFailed, exceptionMessage)); } // Validate claims in the token @@ -349,7 +349,7 @@ private OpenIdConnectConfiguration GetOpenIdConfigForSigningKeys(string url, boo } catch (Exception exception) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.GetAttestationTokenSigningKeysFailed, GetInnerMostExceptionMessage(exception)), exception); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.GetAttestationTokenSigningKeysFailed, GetInnerMostExceptionMessage(exception)), exception); } OpenIdConnectConfigurationCache.Add(url, openIdConnectConfig, DateTime.UtcNow.AddDays(1)); @@ -416,7 +416,7 @@ private bool VerifyTokenSignature(string attestationToken, string tokenIssuerUrl } catch (SecurityTokenExpiredException securityException) { - throw new AlwaysEncryptedAttestationException(SR.ExpiredAttestationToken, securityException); + throw new AlwaysEncryptedAttestationException(Strings.ExpiredAttestationToken, securityException); } catch (SecurityTokenValidationException securityTokenException) { @@ -428,7 +428,7 @@ private bool VerifyTokenSignature(string attestationToken, string tokenIssuerUrl } catch (Exception exception) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.InvalidAttestationToken, GetInnerMostExceptionMessage(exception))); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.InvalidAttestationToken, GetInnerMostExceptionMessage(exception))); } return isSignatureValid; @@ -447,7 +447,7 @@ private byte[] ComputeSHA256(byte[] data) } catch (Exception argumentException) { - throw new AlwaysEncryptedAttestationException(SR.InvalidArgumentToSHA256, argumentException); + throw new AlwaysEncryptedAttestationException(Strings.InvalidArgumentToSHA256, argumentException); } return result; } @@ -464,7 +464,7 @@ private void ValidateAttestationClaims(EnclaveType enclaveType, string attestati } catch (ArgumentException argumentException) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.FailToParseAttestationToken, argumentException.Message)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.FailToParseAttestationToken, argumentException.Message)); } // Get all the claims from the token @@ -492,7 +492,7 @@ private void ValidateClaim(Dictionary claims, string claimName, bool hasClaim = claims.TryGetValue(claimName, out claimData); if (!hasClaim) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.MissingClaimInAttestationToken, claimName)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.MissingClaimInAttestationToken, claimName)); } // Get the Base64Url of the actual data and compare it with claim @@ -503,13 +503,13 @@ private void ValidateClaim(Dictionary claims, string claimName, } catch (Exception) { - throw new AlwaysEncryptedAttestationException(SR.InvalidArgumentToBase64UrlDecoder); + throw new AlwaysEncryptedAttestationException(Strings.InvalidArgumentToBase64UrlDecoder); } bool hasValidClaim = String.Equals(encodedActualData, claimData, StringComparison.Ordinal); if (!hasValidClaim) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.InvalidClaimInAttestationToken, claimName, claimData)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.InvalidClaimInAttestationToken, claimName, claimData)); } } @@ -534,7 +534,7 @@ private byte[] GetSharedSecret(EnclavePublicKey enclavePublicKey, byte[] nonce, { if (!rsacng.VerifyData(enclaveDHInfo.PublicKey, enclaveDHInfo.PublicKeySignature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1)) { - throw new ArgumentException(SR.GetSharedSecretFailed); + throw new ArgumentException(Strings.GetSharedSecretFailed); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/EnclaveSessionCache.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/EnclaveSessionCache.NetCoreApp.cs index 1445918d37..5cf0590d06 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/EnclaveSessionCache.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/EnclaveSessionCache.NetCoreApp.cs @@ -45,7 +45,7 @@ internal void InvalidateSession(string serverName, string enclaveAttestationUrl, SqlEnclaveSession enclaveSessionRemoved = enclaveMemoryCache.Remove(cacheKey) as SqlEnclaveSession; if (enclaveSessionRemoved == null) { - throw new InvalidOperationException(SR.EnclaveSessionInvalidationFailed); + throw new InvalidOperationException(Strings.EnclaveSessionInvalidationFailed); } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Common.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Common.cs index c448789a51..834fa09628 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Common.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Common.cs @@ -39,7 +39,7 @@ private static LocalDBFormatMessageDelegate LocalDBFormatMessage // SNI checks for LocalDBFormatMessage during DLL loading, so it is practically impossible to get this error. int hResult = Marshal.GetLastWin32Error(); SqlClientEventSource.Log.TraceEvent(" GetProcAddress for LocalDBFormatMessage error 0x{0}", hResult); - throw CreateLocalDBException(errorMessage: SR.LocalDB_MethodNotFound); + throw CreateLocalDBException(errorMessage: Strings.LocalDB_MethodNotFound); } s_localDBFormatMessage = Marshal.GetDelegateForFunctionPointer(functionAddr); } @@ -83,12 +83,12 @@ internal static string GetLocalDBMessage(int hrCode) if (hResult >= 0) return buffer.ToString(); else - return string.Format(CultureInfo.CurrentCulture, "{0} (0x{1:X}).", SR.LocalDB_UnobtainableMessage, hResult); + return string.Format(CultureInfo.CurrentCulture, "{0} (0x{1:X}).", Strings.LocalDB_UnobtainableMessage, hResult); } } catch (SqlException exc) { - return string.Format(CultureInfo.CurrentCulture, "{0} ({1}).", SR.LocalDB_UnobtainableMessage, exc.Message); + return string.Format(CultureInfo.CurrentCulture, "{0} ({1}).", Strings.LocalDB_UnobtainableMessage, exc.Message); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs index 02258e6c29..ff85256c56 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Unix.cs @@ -9,6 +9,6 @@ namespace Microsoft.Data internal static partial class LocalDBAPI { internal static string GetLocalDBMessage(int hrCode) => - throw new PlatformNotSupportedException(SR.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported. + throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported. } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Windows.cs index 2c50c2ba3a..d4b3a73133 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.Windows.cs @@ -30,7 +30,7 @@ private static IntPtr UserInstanceDLLHandle { SNINativeMethodWrapper.SNI_Error sniError; SNINativeMethodWrapper.SNIGetLastError(out sniError); - throw CreateLocalDBException(errorMessage: SRHelper.GetString("LocalDB_FailedGetDLLHandle"), sniError: (int)sniError.sniError); + throw CreateLocalDBException(errorMessage: StringsHelper.GetString("LocalDB_FailedGetDLLHandle"), sniError: (int)sniError.sniError); } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.uap.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.uap.cs index f40574502f..9ed10f0fcc 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.uap.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/LocalDBAPI.uap.cs @@ -9,6 +9,6 @@ namespace System.Data internal static partial class LocalDBAPI { private static IntPtr LoadProcAddress() => - throw new PlatformNotSupportedException(SR.LocalDBNotSupported); // No Registry support on UAP + throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // No Registry support on UAP } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Unix.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Unix.cs index 6840e9207d..a9b235d47c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Unix.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Unix.cs @@ -10,7 +10,7 @@ internal class LocalDB { internal static string GetLocalDBConnectionString(string localDbInstance) { - throw new PlatformNotSupportedException(SR.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported. + throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported. } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.uap.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.uap.cs index c8c35aef29..e764375802 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.uap.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.uap.cs @@ -8,7 +8,7 @@ internal class LocalDB { internal static string GetLocalDBConnectionString(string localDbInstance) { - throw new PlatformNotSupportedException(SR.LocalDBNotSupported); // No Registry support on UAP + throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // No Registry support on UAP } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/InvalidUdtException.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/InvalidUdtException.cs index 228f1b7adc..c15bee4e08 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/InvalidUdtException.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/InvalidUdtException.cs @@ -41,8 +41,8 @@ public override void GetObjectData(SerializationInfo si, StreamingContext contex internal static InvalidUdtException Create(Type udtType, string resourceReason) { - string reason = SRHelper.GetString(resourceReason); - string message = SRHelper.GetString(SR.SqlUdt_InvalidUdtMessage, udtType.FullName, reason); + string reason = StringsHelper.GetString(resourceReason); + string message = StringsHelper.GetString(Strings.SqlUdt_InvalidUdtMessage, udtType.FullName, reason); InvalidUdtException e = new InvalidUdtException(message); ADP.TraceExceptionAsReturnValue(e); return e; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlMetaData.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlMetaData.cs index 28210ab548..8a5b0a722a 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlMetaData.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlMetaData.cs @@ -502,49 +502,49 @@ internal string UdtTypeName if (SqlDbType.Char == dbType) { if (maxLength > x_lServerMaxANSI || maxLength < 0) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); lLocale = CultureInfo.CurrentCulture.LCID; } else if (SqlDbType.VarChar == dbType) { if ((maxLength > x_lServerMaxANSI || maxLength < 0) && maxLength != Max) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); lLocale = CultureInfo.CurrentCulture.LCID; } else if (SqlDbType.NChar == dbType) { if (maxLength > x_lServerMaxUnicode || maxLength < 0) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); lLocale = CultureInfo.CurrentCulture.LCID; } else if (SqlDbType.NVarChar == dbType) { if ((maxLength > x_lServerMaxUnicode || maxLength < 0) && maxLength != Max) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); lLocale = CultureInfo.CurrentCulture.LCID; } else if (SqlDbType.NText == dbType || SqlDbType.Text == dbType) { // old-style lobs only allowed with Max length if (SqlMetaData.Max != maxLength) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); lLocale = CultureInfo.CurrentCulture.LCID; } else if (SqlDbType.Binary == dbType) { if (maxLength > x_lServerMaxBinary || maxLength < 0) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.VarBinary == dbType) { if ((maxLength > x_lServerMaxBinary || maxLength < 0) && maxLength != Max) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.Image == dbType) { // old-style lobs only allowed with Max length if (SqlMetaData.Max != maxLength) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else throw SQL.InvalidSqlDbTypeForConstructor(dbType); @@ -579,28 +579,28 @@ internal string UdtTypeName if (SqlDbType.Char == dbType) { if (maxLength > x_lServerMaxANSI || maxLength < 0) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.VarChar == dbType) { if ((maxLength > x_lServerMaxANSI || maxLength < 0) && maxLength != Max) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.NChar == dbType) { if (maxLength > x_lServerMaxUnicode || maxLength < 0) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.NVarChar == dbType) { if ((maxLength > x_lServerMaxUnicode || maxLength < 0) && maxLength != Max) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else if (SqlDbType.NText == dbType || SqlDbType.Text == dbType) { // old-style lobs only allowed with Max length if (SqlMetaData.Max != maxLength) - throw ADP.Argument(System.SRHelper.GetString(SR.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), nameof(maxLength)); } else throw SQL.InvalidSqlDbTypeForConstructor(dbType); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlNorm.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlNorm.cs index 399fff8a25..9ab047679c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlNorm.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlNorm.cs @@ -238,7 +238,7 @@ internal static Normalizer GetNormalizer(Type t) n = new BinaryOrderedUdtNormalizer(t, false); } if (n == null) - throw new Exception(SRHelper.GetString(SR.SQL_CannotCreateNormalizer, t.FullName)); + throw new Exception(StringsHelper.GetString(Strings.SQL_CannotCreateNormalizer, t.FullName)); n._skipNormalize = false; return n; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlSer.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlSer.cs index 7ca46bb8c3..a0bbc2a463 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlSer.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlSer.cs @@ -146,7 +146,7 @@ internal static SqlUserDefinedTypeAttribute GetUdtAttribute(Type t) } else { - throw InvalidUdtException.Create(t, SR.SqlUdtReason_NoUdtAttribute); + throw InvalidUdtException.Create(t, Strings.SqlUdtReason_NoUdtAttribute); } return udtAttr; } @@ -242,7 +242,7 @@ public DummyStream() private void DontDoIt() { - throw new Exception(SRHelper.GetString(SR.Sql_InternalError)); + throw new Exception(StringsHelper.GetString(Strings.Sql_InternalError)); } public override bool CanRead => false; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlUserDefinedAggregateAttribute.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlUserDefinedAggregateAttribute.cs index e74878e2e7..12c1149428 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlUserDefinedAggregateAttribute.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/Server/SqlUserDefinedAggregateAttribute.cs @@ -56,7 +56,7 @@ public int MaxByteSize // MaxByteSize of -1 means 2GB and is valid, as well as 0 to MaxByteSizeValue if (value < -1 || value > MaxByteSizeValue) { - throw ADP.ArgumentOutOfRange(SRHelper.GetString(SR.SQLUDT_MaxByteSizeValue), nameof(MaxByteSize), value); + throw ADP.ArgumentOutOfRange(StringsHelper.GetString(Strings.SQLUDT_MaxByteSizeValue), nameof(MaxByteSize), value); } _maxByteSize = value; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SimulatorEnclaveProvider.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SimulatorEnclaveProvider.NetCoreApp.cs index 542af35688..811816f1e6 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SimulatorEnclaveProvider.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SimulatorEnclaveProvider.NetCoreApp.cs @@ -92,7 +92,7 @@ public override void CreateEnclaveSession(byte[] attestationInfo, ECDiffieHellma } else { - throw new AlwaysEncryptedAttestationException(SR.FailToCreateEnclaveSession); + throw new AlwaysEncryptedAttestationException(Strings.FailToCreateEnclaveSession); } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs index f27482f792..75b5fb04a3 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs @@ -476,7 +476,7 @@ private string CreateInitialQuery() string[] parts; try { - parts = MultipartIdentifier.ParseMultipartIdentifier(this.DestinationTableName, "[\"", "]\"", SR.SQL_BulkCopyDestinationTableName, true); + parts = MultipartIdentifier.ParseMultipartIdentifier(this.DestinationTableName, "[\"", "]\"", Strings.SQL_BulkCopyDestinationTableName, true); } catch (Exception e) { @@ -597,7 +597,7 @@ private string AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet i throw SQL.BulkLoadNoCollation(); } - string[] parts = MultipartIdentifier.ParseMultipartIdentifier(this.DestinationTableName, "[\"", "]\"", SR.SQL_BulkCopyDestinationTableName, true); + string[] parts = MultipartIdentifier.ParseMultipartIdentifier(this.DestinationTableName, "[\"", "]\"", Strings.SQL_BulkCopyDestinationTableName, true); updateBulkCommandText.AppendFormat("insert bulk {0} (", ADP.BuildMultiPartName(parts)); int nmatched = 0; // Number of columns that match and are accepted int nrejected = 0; // Number of columns that match but were rejected diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs index 8c7d707b41..3049feb963 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs @@ -2793,7 +2793,7 @@ internal void DeriveParameters() ValidateCommand(false /*not async*/, nameof(DeriveParameters)); // Use common parser for SqlClient and OleDb - parse into 4 parts - Server, Catalog, Schema, ProcedureName - string[] parsedSProc = MultipartIdentifier.ParseMultipartIdentifier(CommandText, "[\"", "]\"", SR.SQL_SqlCommandCommandText, false); + string[] parsedSProc = MultipartIdentifier.ParseMultipartIdentifier(CommandText, "[\"", "]\"", Strings.SQL_SqlCommandCommandText, false); if (null == parsedSProc[3] || string.IsNullOrEmpty(parsedSProc[3])) { throw ADP.NoStoredProcedureExists(CommandText); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlFileStream.Unsupported.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlFileStream.Unsupported.cs index 19771d0a52..8821657bf7 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlFileStream.Unsupported.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlFileStream.Unsupported.cs @@ -13,38 +13,38 @@ public sealed partial class SqlFileStream : System.IO.Stream /// public SqlFileStream(string path, byte[] transactionContext, FileAccess access) { - throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); + throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// public SqlFileStream(string path, byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize) { - throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); + throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// - public string Name { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public string Name { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public byte[] TransactionContext { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public byte[] TransactionContext { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override bool CanRead { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public override bool CanRead { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override bool CanSeek { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public override bool CanSeek { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override bool CanWrite { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public override bool CanWrite { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override long Length { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public override long Length { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override long Position { get { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } set { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } } + public override long Position { get { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } set { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } /// - public override void Flush() { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } + public override void Flush() { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// - public override int Read(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } + public override int Read(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// - public override long Seek(long offset, System.IO.SeekOrigin origin) { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } + public override long Seek(long offset, System.IO.SeekOrigin origin) { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// - public override void SetLength(long value) { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } + public override void SetLength(long value) { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } /// - public override void Write(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException(SR.SqlFileStream_NotSupported); } + public override void Write(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException(Strings.SqlFileStream_NotSupported); } } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs index 3111fee442..912596b55d 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs @@ -2424,10 +2424,10 @@ internal SqlFedAuthToken GetFedAuthToken(SqlFedAuthInfo fedAuthInfo) SqlClientEventSource.Log.TraceEvent(" {0}", msalException.ErrorCode); // Error[0] SqlErrorCollection sqlErs = new SqlErrorCollection(); - sqlErs.Add(new SqlError(0, (byte)0x00, (byte)TdsEnums.MIN_ERROR_CLASS, ConnectionOptions.DataSource, SRHelper.GetString(SR.SQL_MSALFailure, username, ConnectionOptions.Authentication.ToString("G")), ActiveDirectoryAuthentication.MSALGetAccessTokenFunctionName, 0)); + sqlErs.Add(new SqlError(0, (byte)0x00, (byte)TdsEnums.MIN_ERROR_CLASS, ConnectionOptions.DataSource, StringsHelper.GetString(Strings.SQL_MSALFailure, username, ConnectionOptions.Authentication.ToString("G")), ActiveDirectoryAuthentication.MSALGetAccessTokenFunctionName, 0)); // Error[1] - string errorMessage1 = SRHelper.GetString(SR.SQL_MSALInnerException, msalException.ErrorCode); + string errorMessage1 = StringsHelper.GetString(Strings.SQL_MSALInnerException, msalException.ErrorCode); sqlErs.Add(new SqlError(0, (byte)0x00, (byte)TdsEnums.MIN_ERROR_CLASS, ConnectionOptions.DataSource, errorMessage1, ActiveDirectoryAuthentication.MSALGetAccessTokenFunctionName, 0)); // Error[2] diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlParameter.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlParameter.cs index e646a4fbd7..08029b8a7a 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlParameter.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlParameter.cs @@ -1979,7 +1979,7 @@ internal static string[] ParseTypeName(string typeName, bool isUdtTypeName) try { - string errorMsg = isUdtTypeName ? SR.SQL_UDTTypeName : SR.SQL_TypeName; + string errorMsg = isUdtTypeName ? Strings.SQL_UDTTypeName : Strings.SQL_TypeName; return MultipartIdentifier.ParseMultipartIdentifier(typeName, "[\"", "]\"", '.', 3, true, errorMsg, true); } catch (ArgumentException) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlStatistics.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlStatistics.cs index 32e06b2df0..f6abfd7354 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlStatistics.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlStatistics.cs @@ -291,11 +291,11 @@ private void ValidateCopyToArguments(Array array, int arrayIndex) if (array == null) throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Strings.Arg_RankMultiDimNotSupported); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(arrayIndex), Strings.ArgumentOutOfRange_NeedNonNegNum); if (array.Length - arrayIndex < Count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + throw new ArgumentException(Strings.Arg_ArrayPlusOffTooSmall); } private sealed class Collection : ICollection diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUdtInfo.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUdtInfo.cs index fd95ad195f..7a02ba83fd 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUdtInfo.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUdtInfo.cs @@ -32,7 +32,7 @@ internal static SqlUdtInfo GetFromType(Type target) SqlUdtInfo udtAttr = TryGetFromType(target); if (udtAttr == null) { - throw InvalidUdtException.Create(target, SR.SqlUdtReason_NoUdtAttribute); + throw InvalidUdtException.Create(target, Strings.SqlUdtReason_NoUdtAttribute); } return udtAttr; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUtil.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUtil.cs index 37b42b7512..ebfe96b769 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUtil.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlUtil.cs @@ -246,7 +246,7 @@ internal static class SQL // internal static Exception CannotGetDTCAddress() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_CannotGetDTCAddress)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_CannotGetDTCAddress)); } internal static Exception InvalidInternalPacketSize(string str) @@ -255,119 +255,119 @@ internal static Exception InvalidInternalPacketSize(string str) } internal static Exception InvalidPacketSize() { - return ADP.ArgumentOutOfRange(System.SRHelper.GetString(SR.SQL_InvalidTDSPacketSize)); + return ADP.ArgumentOutOfRange(System.StringsHelper.GetString(Strings.SQL_InvalidTDSPacketSize)); } internal static Exception InvalidPacketSizeValue() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InvalidPacketSizeValue)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InvalidPacketSizeValue)); } internal static Exception InvalidSSPIPacketSize() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InvalidSSPIPacketSize)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InvalidSSPIPacketSize)); } internal static Exception AuthenticationAndIntegratedSecurity() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_AuthenticationAndIntegratedSecurity)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_AuthenticationAndIntegratedSecurity)); } internal static Exception IntegratedWithPassword() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_IntegratedWithPassword)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_IntegratedWithPassword)); } internal static Exception InteractiveWithPassword() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InteractiveWithPassword)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InteractiveWithPassword)); } internal static Exception DeviceFlowWithUsernamePassword() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_DeviceFlowWithUsernamePassword)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_DeviceFlowWithUsernamePassword)); } static internal Exception SettingIntegratedWithCredential() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingIntegratedWithCredential)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingIntegratedWithCredential)); } static internal Exception SettingInteractiveWithCredential() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingInteractiveWithCredential)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingInteractiveWithCredential)); } static internal Exception SettingDeviceFlowWithCredential() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingDeviceFlowWithCredential)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingDeviceFlowWithCredential)); } static internal Exception SettingCredentialWithIntegratedArgument() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_SettingCredentialWithIntegrated)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithIntegrated)); } static internal Exception SettingCredentialWithInteractiveArgument() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_SettingCredentialWithInteractive)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithInteractive)); } static internal Exception SettingCredentialWithDeviceFlowArgument() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_SettingCredentialWithDeviceFlow)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithDeviceFlow)); } static internal Exception SettingCredentialWithIntegratedInvalid() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingCredentialWithIntegrated)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithIntegrated)); } static internal Exception SettingCredentialWithInteractiveInvalid() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingCredentialWithInteractive)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithInteractive)); } static internal Exception SettingCredentialWithDeviceFlowInvalid() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SettingCredentialWithDeviceFlow)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SettingCredentialWithDeviceFlow)); } internal static Exception NullEmptyTransactionName() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_NullEmptyTransactionName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_NullEmptyTransactionName)); } internal static Exception UserInstanceFailoverNotCompatible() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_UserInstanceFailoverNotCompatible)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_UserInstanceFailoverNotCompatible)); } internal static Exception CredentialsNotProvided(SqlAuthenticationMethod auth) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_CredentialsNotProvided, DbConnectionStringBuilderUtil.AuthenticationTypeToString(auth))); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_CredentialsNotProvided, DbConnectionStringBuilderUtil.AuthenticationTypeToString(auth))); } internal static Exception ParsingErrorLibraryType(ParsingErrorState state, int libraryType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorAuthLibraryType, ((int)state).ToString(CultureInfo.InvariantCulture), libraryType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorAuthLibraryType, ((int)state).ToString(CultureInfo.InvariantCulture), libraryType)); } internal static Exception InvalidSQLServerVersionUnknown() { - return ADP.DataAdapter(System.SRHelper.GetString(SR.SQL_InvalidSQLServerVersionUnknown)); + return ADP.DataAdapter(System.StringsHelper.GetString(Strings.SQL_InvalidSQLServerVersionUnknown)); } internal static Exception SynchronousCallMayNotPend() { - return new Exception(System.SRHelper.GetString(SR.Sql_InternalError)); + return new Exception(System.StringsHelper.GetString(Strings.Sql_InternalError)); } internal static Exception ConnectionLockedForBcpEvent() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ConnectionLockedForBcpEvent)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ConnectionLockedForBcpEvent)); } internal static Exception InstanceFailure() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_InstanceFailure)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_InstanceFailure)); } internal static Exception ChangePasswordArgumentMissing(string argumentName) { - return ADP.ArgumentNull(System.SRHelper.GetString(SR.SQL_ChangePasswordArgumentMissing, argumentName)); + return ADP.ArgumentNull(System.StringsHelper.GetString(Strings.SQL_ChangePasswordArgumentMissing, argumentName)); } internal static Exception ChangePasswordConflictsWithSSPI() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_ChangePasswordConflictsWithSSPI)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_ChangePasswordConflictsWithSSPI)); } internal static Exception ChangePasswordRequiresYukon() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ChangePasswordRequiresYukon)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ChangePasswordRequiresYukon)); } internal static Exception ChangePasswordUseOfUnallowedKey(string key) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ChangePasswordUseOfUnallowedKey, key)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ChangePasswordUseOfUnallowedKey, key)); } internal static Exception GlobalizationInvariantModeNotSupported() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_GlobalizationInvariantModeNotSupported)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_GlobalizationInvariantModeNotSupported)); } // @@ -375,97 +375,97 @@ internal static Exception GlobalizationInvariantModeNotSupported() // internal static Exception GlobalTransactionsNotEnabled() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.GT_Disabled)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.GT_Disabled)); } internal static Exception UnknownSysTxIsolationLevel(System.Transactions.IsolationLevel isolationLevel) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_UnknownSysTxIsolationLevel, isolationLevel.ToString())); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_UnknownSysTxIsolationLevel, isolationLevel.ToString())); } internal static Exception InvalidPartnerConfiguration(string server, string database) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_InvalidPartnerConfiguration, server, database)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_InvalidPartnerConfiguration, server, database)); } internal static Exception BatchedUpdateColumnEncryptionSettingMismatch() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_BatchedUpdateColumnEncryptionSettingMismatch, "SqlCommandColumnEncryptionSetting", "SelectCommand", "InsertCommand", "UpdateCommand", "DeleteCommand")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_BatchedUpdateColumnEncryptionSettingMismatch, "SqlCommandColumnEncryptionSetting", "SelectCommand", "InsertCommand", "UpdateCommand", "DeleteCommand")); } internal static Exception MARSUnsupportedOnConnection() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_MarsUnsupportedOnConnection)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_MarsUnsupportedOnConnection)); } internal static Exception CannotModifyPropertyAsyncOperationInProgress([CallerMemberName] string property = "") { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_CannotModifyPropertyAsyncOperationInProgress, property)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_CannotModifyPropertyAsyncOperationInProgress, property)); } internal static Exception NonLocalSSEInstance() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_NonLocalSSEInstance)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_NonLocalSSEInstance)); } // SQL.ActiveDirectoryAuth // internal static Exception UnsupportedAuthentication(string authentication) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_UnsupportedAuthentication, authentication)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_UnsupportedAuthentication, authentication)); } internal static Exception UnsupportedSqlAuthenticationMethod(SqlAuthenticationMethod authentication) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_UnsupportedSqlAuthenticationMethod, authentication)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_UnsupportedSqlAuthenticationMethod, authentication)); } internal static Exception UnsupportedAuthenticationSpecified(SqlAuthenticationMethod authentication) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_UnsupportedAuthenticationSpecified, authentication)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_UnsupportedAuthenticationSpecified, authentication)); } internal static Exception CannotCreateAuthProvider(string authentication, string type, Exception e) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_CannotCreateAuthProvider, authentication, type), e); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_CannotCreateAuthProvider, authentication, type), e); } internal static Exception CannotCreateSqlAuthInitializer(string type, Exception e) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_CannotCreateAuthInitializer, type), e); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_CannotCreateAuthInitializer, type), e); } internal static Exception CannotInitializeAuthProvider(string type, Exception e) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_CannotInitializeAuthProvider, type), e); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_CannotInitializeAuthProvider, type), e); } internal static Exception UnsupportedAuthenticationByProvider(string authentication, string type) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_UnsupportedAuthenticationByProvider, type, authentication)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_UnsupportedAuthenticationByProvider, type, authentication)); } internal static Exception CannotFindAuthProvider(string authentication) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_CannotFindAuthProvider, authentication)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_CannotFindAuthProvider, authentication)); } internal static Exception CannotGetAuthProviderConfig(Exception e) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_CannotGetAuthProviderConfig), e); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_CannotGetAuthProviderConfig), e); } internal static Exception ParameterCannotBeEmpty(string paramName) { - return ADP.ArgumentNull(System.SRHelper.GetString(SR.SQL_ParameterCannotBeEmpty, paramName)); + return ADP.ArgumentNull(System.StringsHelper.GetString(Strings.SQL_ParameterCannotBeEmpty, paramName)); } internal static Exception ActiveDirectoryInteractiveTimeout() { - return ADP.TimeoutException(SR.SQL_Timeout_Active_Directory_Interactive_Authentication); + return ADP.TimeoutException(Strings.SQL_Timeout_Active_Directory_Interactive_Authentication); } internal static Exception ActiveDirectoryDeviceFlowTimeout() { - return ADP.TimeoutException(SR.SQL_Timeout_Active_Directory_DeviceFlow_Authentication); + return ADP.TimeoutException(Strings.SQL_Timeout_Active_Directory_DeviceFlow_Authentication); } @@ -475,7 +475,7 @@ internal static Exception ActiveDirectoryDeviceFlowTimeout() internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, int value) { - return ADP.ArgumentOutOfRange(System.SRHelper.GetString(SR.SQL_NotSupportedEnumerationValue, type.Name, value.ToString(System.Globalization.CultureInfo.InvariantCulture)), type.Name); + return ADP.ArgumentOutOfRange(System.StringsHelper.GetString(Strings.SQL_NotSupportedEnumerationValue, type.Name, value.ToString(System.Globalization.CultureInfo.InvariantCulture)), type.Name); } internal static ArgumentOutOfRangeException NotSupportedCommandType(CommandType value) @@ -521,23 +521,23 @@ internal static ArgumentOutOfRangeException NotSupportedIsolationLevel(System.Da internal static Exception OperationCancelled() { - Exception exception = ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_OperationCancelled)); + Exception exception = ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_OperationCancelled)); return exception; } internal static Exception PendingBeginXXXExists() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_PendingBeginXXXExists)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_PendingBeginXXXExists)); } internal static ArgumentOutOfRangeException InvalidSqlDependencyTimeout(string param) { - return ADP.ArgumentOutOfRange(System.SRHelper.GetString(SR.SqlDependency_InvalidTimeout), param); + return ADP.ArgumentOutOfRange(System.StringsHelper.GetString(Strings.SqlDependency_InvalidTimeout), param); } internal static Exception NonXmlResult() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_NonXmlResult)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_NonXmlResult)); } // @@ -545,27 +545,27 @@ internal static Exception NonXmlResult() // internal static Exception InvalidUdt3PartNameFormat() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InvalidUdt3PartNameFormat)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InvalidUdt3PartNameFormat)); } internal static Exception InvalidParameterTypeNameFormat() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InvalidParameterTypeNameFormat)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InvalidParameterTypeNameFormat)); } internal static Exception InvalidParameterNameLength(string value) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_InvalidParameterNameLength, value)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_InvalidParameterNameLength, value)); } internal static Exception PrecisionValueOutOfRange(byte precision) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_PrecisionValueOutOfRange, precision.ToString(CultureInfo.InvariantCulture))); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_PrecisionValueOutOfRange, precision.ToString(CultureInfo.InvariantCulture))); } internal static Exception ScaleValueOutOfRange(byte scale) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_ScaleValueOutOfRange, scale.ToString(CultureInfo.InvariantCulture))); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_ScaleValueOutOfRange, scale.ToString(CultureInfo.InvariantCulture))); } internal static Exception TimeScaleValueOutOfRange(byte scale) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_TimeScaleValueOutOfRange, scale.ToString(CultureInfo.InvariantCulture))); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_TimeScaleValueOutOfRange, scale.ToString(CultureInfo.InvariantCulture))); } internal static Exception InvalidSqlDbType(SqlDbType value) { @@ -573,41 +573,41 @@ internal static Exception InvalidSqlDbType(SqlDbType value) } internal static Exception UnsupportedTVPOutputParameter(ParameterDirection direction, string paramName) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SqlParameter_UnsupportedTVPOutputParameter, + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SqlParameter_UnsupportedTVPOutputParameter, direction.ToString(), paramName)); } internal static Exception DBNullNotSupportedForTVPValues(string paramName) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SqlParameter_DBNullNotSupportedForTVP, paramName)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SqlParameter_DBNullNotSupportedForTVP, paramName)); } internal static Exception UnexpectedTypeNameForNonStructParams(string paramName) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SqlParameter_UnexpectedTypeNameForNonStruct, paramName)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SqlParameter_UnexpectedTypeNameForNonStruct, paramName)); } internal static Exception ParameterInvalidVariant(string paramName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParameterInvalidVariant, paramName)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParameterInvalidVariant, paramName)); } internal static Exception MustSetTypeNameForParam(string paramType, string paramName) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_ParameterTypeNameRequired, paramType, paramName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_ParameterTypeNameRequired, paramType, paramName)); } internal static Exception NullSchemaTableDataTypeNotSupported(string columnName) { - return ADP.Argument(System.SRHelper.GetString(SR.NullSchemaTableDataTypeNotSupported, columnName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.NullSchemaTableDataTypeNotSupported, columnName)); } internal static Exception InvalidSchemaTableOrdinals() { - return ADP.Argument(System.SRHelper.GetString(SR.InvalidSchemaTableOrdinals)); + return ADP.Argument(System.StringsHelper.GetString(Strings.InvalidSchemaTableOrdinals)); } internal static Exception EnumeratedRecordMetaDataChanged(string fieldName, int recordNumber) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_EnumeratedRecordMetaDataChanged, fieldName, recordNumber)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_EnumeratedRecordMetaDataChanged, fieldName, recordNumber)); } internal static Exception EnumeratedRecordFieldCountChanged(int recordNumber) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_EnumeratedRecordFieldCountChanged, recordNumber)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_EnumeratedRecordFieldCountChanged, recordNumber)); } // @@ -619,59 +619,59 @@ internal static Exception EnumeratedRecordFieldCountChanged(int recordNumber) // internal static Exception InvalidTDSVersion() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_InvalidTDSVersion)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_InvalidTDSVersion)); } internal static Exception ParsingError() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingError)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingError)); } internal static Exception ParsingError(ParsingErrorState state) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture))); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture))); } internal static Exception ParsingError(ParsingErrorState state, Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture)), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture)), innerException); } internal static Exception ParsingErrorValue(ParsingErrorState state, int value) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorValue, ((int)state).ToString(CultureInfo.InvariantCulture), value)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorValue, ((int)state).ToString(CultureInfo.InvariantCulture), value)); } internal static Exception ParsingErrorFeatureId(ParsingErrorState state, int featureId) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorFeatureId, ((int)state).ToString(CultureInfo.InvariantCulture), featureId)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorFeatureId, ((int)state).ToString(CultureInfo.InvariantCulture), featureId)); } internal static Exception ParsingErrorToken(ParsingErrorState state, int token) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorToken, ((int)state).ToString(CultureInfo.InvariantCulture), token)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorToken, ((int)state).ToString(CultureInfo.InvariantCulture), token)); } internal static Exception ParsingErrorLength(ParsingErrorState state, int length) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorLength, ((int)state).ToString(CultureInfo.InvariantCulture), length)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorLength, ((int)state).ToString(CultureInfo.InvariantCulture), length)); } internal static Exception ParsingErrorStatus(ParsingErrorState state, int status) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorStatus, ((int)state).ToString(CultureInfo.InvariantCulture), status)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorStatus, ((int)state).ToString(CultureInfo.InvariantCulture), status)); } internal static Exception ParsingErrorOffset(ParsingErrorState state, int offset) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ParsingErrorOffset, ((int)state).ToString(CultureInfo.InvariantCulture), offset)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ParsingErrorOffset, ((int)state).ToString(CultureInfo.InvariantCulture), offset)); } internal static Exception MoneyOverflow(string moneyValue) { - return ADP.Overflow(System.SRHelper.GetString(SR.SQL_MoneyOverflow, moneyValue)); + return ADP.Overflow(System.StringsHelper.GetString(Strings.SQL_MoneyOverflow, moneyValue)); } internal static Exception SmallDateTimeOverflow(string datetime) { - return ADP.Overflow(System.SRHelper.GetString(SR.SQL_SmallDateTimeOverflow, datetime)); + return ADP.Overflow(System.StringsHelper.GetString(Strings.SQL_SmallDateTimeOverflow, datetime)); } internal static Exception SNIPacketAllocationFailure() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_SNIPacketAllocationFailure)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_SNIPacketAllocationFailure)); } internal static Exception TimeOverflow(string time) { - return ADP.Overflow(System.SRHelper.GetString(SR.SQL_TimeOverflow, time)); + return ADP.Overflow(System.StringsHelper.GetString(Strings.SQL_TimeOverflow, time)); } // @@ -679,47 +679,47 @@ internal static Exception TimeOverflow(string time) // internal static Exception InvalidRead() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_InvalidRead)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_InvalidRead)); } internal static Exception NonBlobColumn(string columnName) { - return ADP.InvalidCast(System.SRHelper.GetString(SR.SQL_NonBlobColumn, columnName)); + return ADP.InvalidCast(System.StringsHelper.GetString(Strings.SQL_NonBlobColumn, columnName)); } internal static Exception NonCharColumn(string columnName) { - return ADP.InvalidCast(System.SRHelper.GetString(SR.SQL_NonCharColumn, columnName)); + return ADP.InvalidCast(System.StringsHelper.GetString(Strings.SQL_NonCharColumn, columnName)); } internal static Exception StreamNotSupportOnColumnType(string columnName) { - return ADP.InvalidCast(System.SRHelper.GetString(SR.SQL_StreamNotSupportOnColumnType, columnName)); + return ADP.InvalidCast(System.StringsHelper.GetString(Strings.SQL_StreamNotSupportOnColumnType, columnName)); } internal static Exception StreamNotSupportOnEncryptedColumn(string columnName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_StreamNotSupportOnEncryptedColumn, columnName, "Stream")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_StreamNotSupportOnEncryptedColumn, columnName, "Stream")); } internal static Exception SequentialAccessNotSupportedOnEncryptedColumn(string columnName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_SequentialAccessNotSupportedOnEncryptedColumn, columnName, "CommandBehavior=SequentialAccess")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_SequentialAccessNotSupportedOnEncryptedColumn, columnName, "CommandBehavior=SequentialAccess")); } internal static Exception TextReaderNotSupportOnColumnType(string columnName) { - return ADP.InvalidCast(System.SRHelper.GetString(SR.SQL_TextReaderNotSupportOnColumnType, columnName)); + return ADP.InvalidCast(System.StringsHelper.GetString(Strings.SQL_TextReaderNotSupportOnColumnType, columnName)); } internal static Exception XmlReaderNotSupportOnColumnType(string columnName) { - return ADP.InvalidCast(System.SRHelper.GetString(SR.SQL_XmlReaderNotSupportOnColumnType, columnName)); + return ADP.InvalidCast(System.StringsHelper.GetString(Strings.SQL_XmlReaderNotSupportOnColumnType, columnName)); } internal static Exception UDTUnexpectedResult(string exceptionText) { - return ADP.TypeLoad(System.SRHelper.GetString(SR.SQLUDT_Unexpected, exceptionText)); + return ADP.TypeLoad(System.StringsHelper.GetString(Strings.SQLUDT_Unexpected, exceptionText)); } // @@ -727,42 +727,42 @@ internal static Exception UDTUnexpectedResult(string exceptionText) // internal static Exception SqlCommandHasExistingSqlNotificationRequest() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQLNotify_AlreadyHasCommand)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQLNotify_AlreadyHasCommand)); } internal static Exception SqlDepDefaultOptionsButNoStart() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_DefaultOptionsButNoStart)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_DefaultOptionsButNoStart)); } internal static Exception SqlDependencyDatabaseBrokerDisabled() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_DatabaseBrokerDisabled)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_DatabaseBrokerDisabled)); } internal static Exception SqlDependencyEventNoDuplicate() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_EventNoDuplicate)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_EventNoDuplicate)); } internal static Exception SqlDependencyDuplicateStart() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_DuplicateStart)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_DuplicateStart)); } internal static Exception SqlDependencyIdMismatch() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_IdMismatch)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_IdMismatch)); } internal static Exception SqlDependencyNoMatchingServerStart() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_NoMatchingServerStart)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_NoMatchingServerStart)); } internal static Exception SqlDependencyNoMatchingServerDatabaseStart() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlDependency_NoMatchingServerDatabaseStart)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlDependency_NoMatchingServerDatabaseStart)); } // @@ -770,7 +770,7 @@ internal static Exception SqlDependencyNoMatchingServerDatabaseStart() // internal static TransactionPromotionException PromotionFailed(Exception inner) { - TransactionPromotionException e = new TransactionPromotionException(System.SRHelper.GetString(SR.SqlDelegatedTransaction_PromotionFailed), inner); + TransactionPromotionException e = new TransactionPromotionException(System.StringsHelper.GetString(Strings.SqlDelegatedTransaction_PromotionFailed), inner); ADP.TraceExceptionAsReturnValue(e); return e; } @@ -781,30 +781,30 @@ internal static TransactionPromotionException PromotionFailed(Exception inner) // internal static Exception UnexpectedUdtTypeNameForNonUdtParams() { - return ADP.Argument(System.SRHelper.GetString(SR.SQLUDT_UnexpectedUdtTypeName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQLUDT_UnexpectedUdtTypeName)); } internal static Exception MustSetUdtTypeNameForUdtParams() { - return ADP.Argument(System.SRHelper.GetString(SR.SQLUDT_InvalidUdtTypeName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQLUDT_InvalidUdtTypeName)); } internal static Exception UDTInvalidSqlType(string typeName) { - return ADP.Argument(System.SRHelper.GetString(SR.SQLUDT_InvalidSqlType, typeName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQLUDT_InvalidSqlType, typeName)); } internal static Exception UDTInvalidSize(int maxSize, int maxSupportedSize) { - throw ADP.ArgumentOutOfRange(System.SRHelper.GetString(SR.SQLUDT_InvalidSize, maxSize, maxSupportedSize)); + throw ADP.ArgumentOutOfRange(System.StringsHelper.GetString(Strings.SQLUDT_InvalidSize, maxSize, maxSupportedSize)); } internal static Exception InvalidSqlDbTypeForConstructor(SqlDbType type) { - return ADP.Argument(System.SRHelper.GetString(SR.SqlMetaData_InvalidSqlDbTypeForConstructorFormat, type.ToString())); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlMetaData_InvalidSqlDbTypeForConstructorFormat, type.ToString())); } internal static Exception NameTooLong(string parameterName) { - return ADP.Argument(System.SRHelper.GetString(SR.SqlMetaData_NameTooLong), parameterName); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlMetaData_NameTooLong), parameterName); } internal static Exception InvalidSortOrder(SortOrder order) @@ -814,40 +814,40 @@ internal static Exception InvalidSortOrder(SortOrder order) internal static Exception MustSpecifyBothSortOrderAndOrdinal(SortOrder order, int ordinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlMetaData_SpecifyBothSortOrderAndOrdinal, order.ToString(), ordinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlMetaData_SpecifyBothSortOrderAndOrdinal, order.ToString(), ordinal)); } internal static Exception UnsupportedColumnTypeForSqlProvider(string columnName, string typeName) { - return ADP.Argument(System.SRHelper.GetString(SR.SqlProvider_InvalidDataColumnType, columnName, typeName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlProvider_InvalidDataColumnType, columnName, typeName)); } internal static Exception InvalidColumnMaxLength(string columnName, long maxLength) { - return ADP.Argument(System.SRHelper.GetString(SR.SqlProvider_InvalidDataColumnMaxLength, columnName, maxLength)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlProvider_InvalidDataColumnMaxLength, columnName, maxLength)); } internal static Exception InvalidColumnPrecScale() { - return ADP.Argument(System.SRHelper.GetString(SR.SqlMisc_InvalidPrecScaleMessage)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlMisc_InvalidPrecScaleMessage)); } internal static Exception NotEnoughColumnsInStructuredType() { - return ADP.Argument(System.SRHelper.GetString(SR.SqlProvider_NotEnoughColumnsInStructuredType)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SqlProvider_NotEnoughColumnsInStructuredType)); } internal static Exception DuplicateSortOrdinal(int sortOrdinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlProvider_DuplicateSortOrdinal, sortOrdinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlProvider_DuplicateSortOrdinal, sortOrdinal)); } internal static Exception MissingSortOrdinal(int sortOrdinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlProvider_MissingSortOrdinal, sortOrdinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlProvider_MissingSortOrdinal, sortOrdinal)); } internal static Exception SortOrdinalGreaterThanFieldCount(int columnOrdinal, int sortOrdinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlProvider_SortOrdinalGreaterThanFieldCount, sortOrdinal, columnOrdinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlProvider_SortOrdinalGreaterThanFieldCount, sortOrdinal, columnOrdinal)); } internal static Exception IEnumerableOfSqlDataRecordHasNoRows() { - return ADP.Argument(System.SRHelper.GetString(SR.IEnumerableOfSqlDataRecordHasNoRows)); + return ADP.Argument(System.StringsHelper.GetString(Strings.IEnumerableOfSqlDataRecordHasNoRows)); } @@ -858,11 +858,11 @@ internal static Exception IEnumerableOfSqlDataRecordHasNoRows() // internal static Exception BulkLoadMappingInaccessible() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadMappingInaccessible)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadMappingInaccessible)); } internal static Exception BulkLoadMappingsNamesOrOrdinalsOnly() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadMappingsNamesOrOrdinalsOnly)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadMappingsNamesOrOrdinalsOnly)); } internal static Exception BulkLoadCannotConvertValue(Type sourcetype, MetaType metatype, int ordinal, int rowNumber, bool isEncrypted, string columnName, string value, Exception e) { @@ -873,16 +873,16 @@ internal static Exception BulkLoadCannotConvertValue(Type sourcetype, MetaType m } if (rowNumber == -1) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadCannotConvertValueWithoutRowNo, quotedValue, sourcetype.Name, metatype.TypeName, ordinal, columnName), e); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadCannotConvertValueWithoutRowNo, quotedValue, sourcetype.Name, metatype.TypeName, ordinal, columnName), e); } else { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadCannotConvertValue, quotedValue, sourcetype.Name, metatype.TypeName, ordinal, columnName, rowNumber), e); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadCannotConvertValue, quotedValue, sourcetype.Name, metatype.TypeName, ordinal, columnName, rowNumber), e); } } internal static Exception BulkLoadNonMatchingColumnMapping() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadNonMatchingColumnMapping)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadNonMatchingColumnMapping)); } internal static Exception BulkLoadNonMatchingColumnName(string columnName) { @@ -890,79 +890,79 @@ internal static Exception BulkLoadNonMatchingColumnName(string columnName) } internal static Exception BulkLoadNonMatchingColumnName(string columnName, Exception e) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadNonMatchingColumnName, columnName), e); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadNonMatchingColumnName, columnName), e); } internal static Exception BulkLoadNullEmptyColumnName(string paramName) { - return ADP.Argument(string.Format(System.SRHelper.GetString(SR.SQL_ParameterCannotBeEmpty), paramName)); + return ADP.Argument(string.Format(System.StringsHelper.GetString(Strings.SQL_ParameterCannotBeEmpty), paramName)); } internal static Exception BulkLoadUnspecifiedSortOrder() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_BulkLoadUnspecifiedSortOrder)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_BulkLoadUnspecifiedSortOrder)); } internal static Exception BulkLoadInvalidOrderHint() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_BulkLoadInvalidOrderHint)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_BulkLoadInvalidOrderHint)); } internal static Exception BulkLoadOrderHintInvalidColumn(string columnName) { - return ADP.InvalidOperation(string.Format(System.SRHelper.GetString(SR.SQL_BulkLoadOrderHintInvalidColumn), columnName)); + return ADP.InvalidOperation(string.Format(System.StringsHelper.GetString(Strings.SQL_BulkLoadOrderHintInvalidColumn), columnName)); } internal static Exception BulkLoadOrderHintDuplicateColumn(string columnName) { - return ADP.InvalidOperation(string.Format(System.SRHelper.GetString(SR.SQL_BulkLoadOrderHintDuplicateColumn), columnName)); + return ADP.InvalidOperation(string.Format(System.StringsHelper.GetString(Strings.SQL_BulkLoadOrderHintDuplicateColumn), columnName)); } internal static Exception BulkLoadStringTooLong(string tableName, string columnName, string truncatedValue) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadStringTooLong, tableName, columnName, truncatedValue)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadStringTooLong, tableName, columnName, truncatedValue)); } internal static Exception BulkLoadInvalidVariantValue() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadInvalidVariantValue)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadInvalidVariantValue)); } internal static Exception BulkLoadInvalidTimeout(int timeout) { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_BulkLoadInvalidTimeout, timeout.ToString(CultureInfo.InvariantCulture))); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_BulkLoadInvalidTimeout, timeout.ToString(CultureInfo.InvariantCulture))); } internal static Exception BulkLoadExistingTransaction() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadExistingTransaction)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadExistingTransaction)); } internal static Exception BulkLoadNoCollation() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadNoCollation)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadNoCollation)); } internal static Exception BulkLoadConflictingTransactionOption() { - return ADP.Argument(System.SRHelper.GetString(SR.SQL_BulkLoadConflictingTransactionOption)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQL_BulkLoadConflictingTransactionOption)); } internal static Exception BulkLoadLcidMismatch(int sourceLcid, string sourceColumnName, int destinationLcid, string destinationColumnName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.Sql_BulkLoadLcidMismatch, sourceLcid, sourceColumnName, destinationLcid, destinationColumnName)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.Sql_BulkLoadLcidMismatch, sourceLcid, sourceColumnName, destinationLcid, destinationColumnName)); } internal static Exception InvalidOperationInsideEvent() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadInvalidOperationInsideEvent)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadInvalidOperationInsideEvent)); } internal static Exception BulkLoadMissingDestinationTable() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadMissingDestinationTable)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadMissingDestinationTable)); } internal static Exception BulkLoadInvalidDestinationTable(string tableName, Exception inner) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadInvalidDestinationTable, tableName), inner); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadInvalidDestinationTable, tableName), inner); } internal static Exception BulkLoadBulkLoadNotAllowDBNull(string columnName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadNotAllowDBNull, columnName)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadNotAllowDBNull, columnName)); } internal static Exception BulkLoadPendingOperation() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BulkLoadPendingOperation)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BulkLoadPendingOperation)); } internal static Exception InvalidTableDerivedPrecisionForTvp(string columnName, byte precision) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlParameter_InvalidTableDerivedPrecisionForTvp, precision, columnName, System.Data.SqlTypes.SqlDecimal.MaxPrecision)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlParameter_InvalidTableDerivedPrecisionForTvp, precision, columnName, System.Data.SqlTypes.SqlDecimal.MaxPrecision)); } // @@ -970,17 +970,17 @@ internal static Exception InvalidTableDerivedPrecisionForTvp(string columnName, // internal static Exception ConnectionDoomed() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_ConnectionDoomed)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_ConnectionDoomed)); } internal static Exception OpenResultCountExceeded() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_OpenResultCountExceeded)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_OpenResultCountExceeded)); } internal static Exception UnsupportedSysTxForGlobalTransactions() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_UnsupportedSysTxVersion)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_UnsupportedSysTxVersion)); } internal static readonly byte[] AttentionHeader = new byte[] { @@ -1005,7 +1005,7 @@ internal static Exception UnsupportedSysTxForGlobalTransactions() /// internal static Exception MultiSubnetFailoverWithFailoverPartner(bool serverProvidedFailoverPartner, SqlInternalConnectionTds internalConnection) { - string msg = System.SRHelper.GetString(SR.SQLMSF_FailoverPartnerNotSupported); + string msg = System.StringsHelper.GetString(Strings.SQLMSF_FailoverPartnerNotSupported); if (serverProvidedFailoverPartner) { // Replacing InvalidOperation with SQL exception @@ -1045,13 +1045,13 @@ internal static Exception MultiSubnetFailoverWithNonTcpProtocol() internal static Exception ROR_FailoverNotSupportedConnString() { - return ADP.Argument(System.SRHelper.GetString(SR.SQLROR_FailoverNotSupported)); + return ADP.Argument(System.StringsHelper.GetString(Strings.SQLROR_FailoverNotSupported)); } internal static Exception ROR_FailoverNotSupportedServer(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.SRHelper.GetString(SR.SQLROR_FailoverNotSupported)), "", 0)); + errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.StringsHelper.GetString(Strings.SQLROR_FailoverNotSupported)), "", 0)); SqlException exc = SqlException.CreateException(errors, null, internalConnection); exc._doNotReconnect = true; return exc; @@ -1060,7 +1060,7 @@ internal static Exception ROR_FailoverNotSupportedServer(SqlInternalConnectionTd internal static Exception ROR_RecursiveRoutingNotSupported(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.SRHelper.GetString(SR.SQLROR_RecursiveRoutingNotSupported)), "", 0)); + errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.StringsHelper.GetString(Strings.SQLROR_RecursiveRoutingNotSupported)), "", 0)); SqlException exc = SqlException.CreateException(errors, null, internalConnection); exc._doNotReconnect = true; return exc; @@ -1069,7 +1069,7 @@ internal static Exception ROR_RecursiveRoutingNotSupported(SqlInternalConnection internal static Exception ROR_UnexpectedRoutingInfo(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.SRHelper.GetString(SR.SQLROR_UnexpectedRoutingInfo)), "", 0)); + errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.StringsHelper.GetString(Strings.SQLROR_UnexpectedRoutingInfo)), "", 0)); SqlException exc = SqlException.CreateException(errors, null, internalConnection); exc._doNotReconnect = true; return exc; @@ -1078,7 +1078,7 @@ internal static Exception ROR_UnexpectedRoutingInfo(SqlInternalConnectionTds int internal static Exception ROR_InvalidRoutingInfo(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.SRHelper.GetString(SR.SQLROR_InvalidRoutingInfo)), "", 0)); + errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.StringsHelper.GetString(Strings.SQLROR_InvalidRoutingInfo)), "", 0)); SqlException exc = SqlException.CreateException(errors, null, internalConnection); exc._doNotReconnect = true; return exc; @@ -1087,7 +1087,7 @@ internal static Exception ROR_InvalidRoutingInfo(SqlInternalConnectionTds intern internal static Exception ROR_TimeoutAfterRoutingInfo(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.SRHelper.GetString(SR.SQLROR_TimeoutAfterRoutingInfo)), "", 0)); + errors.Add(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, null, (System.StringsHelper.GetString(Strings.SQLROR_TimeoutAfterRoutingInfo)), "", 0)); SqlException exc = SqlException.CreateException(errors, null, internalConnection); exc._doNotReconnect = true; return exc; @@ -1115,7 +1115,7 @@ internal static SqlException CR_ReconnectionCancelled() internal static Exception CR_NextAttemptWillExceedQueryTimeout(SqlException innerException, Guid connectionId) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.MIN_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_NextAttemptWillExceedQueryTimeout), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.MIN_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_NextAttemptWillExceedQueryTimeout), "", 0)); SqlException exc = SqlException.CreateException(errors, "", connectionId, innerException); return exc; } @@ -1123,7 +1123,7 @@ internal static Exception CR_NextAttemptWillExceedQueryTimeout(SqlException inne internal static Exception CR_EncryptionChanged(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_EncryptionChanged), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_EncryptionChanged), "", 0)); SqlException exc = SqlException.CreateException(errors, "", internalConnection); return exc; } @@ -1131,7 +1131,7 @@ internal static Exception CR_EncryptionChanged(SqlInternalConnectionTds internal internal static SqlException CR_AllAttemptsFailed(SqlException innerException, Guid connectionId) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.MIN_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_AllAttemptsFailed), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.MIN_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_AllAttemptsFailed), "", 0)); SqlException exc = SqlException.CreateException(errors, "", connectionId, innerException); return exc; } @@ -1139,7 +1139,7 @@ internal static SqlException CR_AllAttemptsFailed(SqlException innerException, G internal static SqlException CR_NoCRAckAtReconnection(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_NoCRAckAtReconnection), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_NoCRAckAtReconnection), "", 0)); SqlException exc = SqlException.CreateException(errors, "", internalConnection); return exc; } @@ -1147,7 +1147,7 @@ internal static SqlException CR_NoCRAckAtReconnection(SqlInternalConnectionTds i internal static SqlException CR_TDSVersionNotPreserved(SqlInternalConnectionTds internalConnection) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_TDSVestionNotPreserved), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_TDSVestionNotPreserved), "", 0)); SqlException exc = SqlException.CreateException(errors, "", internalConnection); return exc; } @@ -1155,7 +1155,7 @@ internal static SqlException CR_TDSVersionNotPreserved(SqlInternalConnectionTds internal static SqlException CR_UnrecoverableServer(Guid connectionId) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_UnrecoverableServer), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_UnrecoverableServer), "", 0)); SqlException exc = SqlException.CreateException(errors, "", connectionId); return exc; } @@ -1163,22 +1163,22 @@ internal static SqlException CR_UnrecoverableServer(Guid connectionId) internal static SqlException CR_UnrecoverableClient(Guid connectionId) { SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQLCR_UnrecoverableClient), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQLCR_UnrecoverableClient), "", 0)); SqlException exc = SqlException.CreateException(errors, "", connectionId); return exc; } internal static Exception StreamWriteNotSupported() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_StreamWriteNotSupported)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_StreamWriteNotSupported)); } internal static Exception StreamReadNotSupported() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_StreamReadNotSupported)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_StreamReadNotSupported)); } internal static Exception StreamSeekNotSupported() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_StreamSeekNotSupported)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_StreamSeekNotSupported)); } internal static System.Data.SqlTypes.SqlNullValueException SqlNullValue() { @@ -1187,31 +1187,31 @@ internal static System.Data.SqlTypes.SqlNullValueException SqlNullValue() } internal static Exception SubclassMustOverride() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlMisc_SubclassMustOverride)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlMisc_SubclassMustOverride)); } // ProjectK\CoreCLR specific errors internal static Exception UnsupportedKeyword(string keyword) { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_UnsupportedKeyword, keyword)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_UnsupportedKeyword, keyword)); } internal static Exception NetworkLibraryKeywordNotSupported() { - return ADP.NotSupported(System.SRHelper.GetString(SR.SQL_NetworkLibraryNotSupported)); + return ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_NetworkLibraryNotSupported)); } internal static Exception UnsupportedFeatureAndToken(SqlInternalConnectionTds internalConnection, string token) { - var innerException = ADP.NotSupported(System.SRHelper.GetString(SR.SQL_UnsupportedToken, token)); + var innerException = ADP.NotSupported(System.StringsHelper.GetString(Strings.SQL_UnsupportedToken, token)); SqlErrorCollection errors = new SqlErrorCollection(); - errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.SRHelper.GetString(SR.SQL_UnsupportedFeature), "", 0)); + errors.Add(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, null, System.StringsHelper.GetString(Strings.SQL_UnsupportedFeature), "", 0)); SqlException exc = SqlException.CreateException(errors, "", internalConnection, innerException); return exc; } internal static Exception BatchedUpdatesNotAvailableOnContextConnection() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.SQL_BatchedUpdatesNotAvailableOnContextConnection)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SQL_BatchedUpdatesNotAvailableOnContextConnection)); } #region Always Encrypted Errors @@ -1219,291 +1219,291 @@ internal static Exception BatchedUpdatesNotAvailableOnContextConnection() #region Always Encrypted - Certificate Store Provider Errors internal static Exception InvalidKeyEncryptionAlgorithm(string encryptionAlgorithm, string validEncryptionAlgorithm, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidKeyEncryptionAlgorithmSysErr : SR.TCE_InvalidKeyEncryptionAlgorithm; - return ADP.Argument(System.SRHelper.GetString(message, encryptionAlgorithm, validEncryptionAlgorithm), TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM); + string message = isSystemOp ? Strings.TCE_InvalidKeyEncryptionAlgorithmSysErr : Strings.TCE_InvalidKeyEncryptionAlgorithm; + return ADP.Argument(System.StringsHelper.GetString(message, encryptionAlgorithm, validEncryptionAlgorithm), TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM); } internal static Exception NullKeyEncryptionAlgorithm(bool isSystemOp) { - string message = isSystemOp ? SR.TCE_NullKeyEncryptionAlgorithmSysErr : SR.TCE_NullKeyEncryptionAlgorithm; - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, System.SRHelper.GetString(message)); + string message = isSystemOp ? Strings.TCE_NullKeyEncryptionAlgorithmSysErr : Strings.TCE_NullKeyEncryptionAlgorithm; + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, System.StringsHelper.GetString(message)); } internal static Exception EmptyColumnEncryptionKey() { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_EmptyColumnEncryptionKey), TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_EmptyColumnEncryptionKey), TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY); } internal static Exception NullColumnEncryptionKey() { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY, System.SRHelper.GetString(SR.TCE_NullColumnEncryptionKey)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY, System.StringsHelper.GetString(Strings.TCE_NullColumnEncryptionKey)); } internal static Exception EmptyEncryptedColumnEncryptionKey() { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_EmptyEncryptedColumnEncryptionKey), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_EmptyEncryptedColumnEncryptionKey), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception NullEncryptedColumnEncryptionKey() { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTED_CEK, System.SRHelper.GetString(SR.TCE_NullEncryptedColumnEncryptionKey)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTED_CEK, System.StringsHelper.GetString(Strings.TCE_NullEncryptedColumnEncryptionKey)); } internal static Exception LargeCertificatePathLength(int actualLength, int maxLength, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_LargeCertificatePathLengthSysErr : SR.TCE_LargeCertificatePathLength; - return ADP.Argument(System.SRHelper.GetString(message, actualLength, maxLength), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_LargeCertificatePathLengthSysErr : Strings.TCE_LargeCertificatePathLength; + return ADP.Argument(System.StringsHelper.GetString(message, actualLength, maxLength), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception NullCertificatePath(string[] validLocations, bool isSystemOp) { Debug.Assert(2 == validLocations.Length); - string message = isSystemOp ? SR.TCE_NullCertificatePathSysErr : SR.TCE_NullCertificatePath; - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.SRHelper.GetString(message, validLocations[0], validLocations[1], @"/")); + string message = isSystemOp ? Strings.TCE_NullCertificatePathSysErr : Strings.TCE_NullCertificatePath; + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.StringsHelper.GetString(message, validLocations[0], validLocations[1], @"/")); } internal static Exception NullCspKeyPath(bool isSystemOp) { - string message = isSystemOp ? SR.TCE_NullCspPathSysErr : SR.TCE_NullCspPath; - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.SRHelper.GetString(message, @"/")); + string message = isSystemOp ? Strings.TCE_NullCspPathSysErr : Strings.TCE_NullCspPath; + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.StringsHelper.GetString(message, @"/")); } internal static Exception NullCngKeyPath(bool isSystemOp) { - string message = isSystemOp ? SR.TCE_NullCngPathSysErr : SR.TCE_NullCngPath; - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.SRHelper.GetString(message, @"/")); + string message = isSystemOp ? Strings.TCE_NullCngPathSysErr : Strings.TCE_NullCngPath; + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, System.StringsHelper.GetString(message, @"/")); } internal static Exception InvalidCertificatePath(string actualCertificatePath, string[] validLocations, bool isSystemOp) { Debug.Assert(2 == validLocations.Length); - string message = isSystemOp ? SR.TCE_InvalidCertificatePathSysErr : SR.TCE_InvalidCertificatePath; - return ADP.Argument(System.SRHelper.GetString(message, actualCertificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCertificatePathSysErr : Strings.TCE_InvalidCertificatePath; + return ADP.Argument(System.StringsHelper.GetString(message, actualCertificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCspPath(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCspPathSysErr : SR.TCE_InvalidCspPath; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCspPathSysErr : Strings.TCE_InvalidCspPath; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCngPath(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCngPathSysErr : SR.TCE_InvalidCngPath; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCngPathSysErr : Strings.TCE_InvalidCngPath; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception EmptyCspName(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_EmptyCspNameSysErr : SR.TCE_EmptyCspName; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_EmptyCspNameSysErr : Strings.TCE_EmptyCspName; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception EmptyCngName(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_EmptyCngNameSysErr : SR.TCE_EmptyCngName; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_EmptyCngNameSysErr : Strings.TCE_EmptyCngName; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception EmptyCspKeyId(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_EmptyCspKeyIdSysErr : SR.TCE_EmptyCspKeyId; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_EmptyCspKeyIdSysErr : Strings.TCE_EmptyCspKeyId; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception EmptyCngKeyId(string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_EmptyCngKeyIdSysErr : SR.TCE_EmptyCngKeyId; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_EmptyCngKeyIdSysErr : Strings.TCE_EmptyCngKeyId; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCspName(string cspName, string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCspNameSysErr : SR.TCE_InvalidCspName; - return ADP.Argument(System.SRHelper.GetString(message, cspName, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCspNameSysErr : Strings.TCE_InvalidCspName; + return ADP.Argument(System.StringsHelper.GetString(message, cspName, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCspKeyIdentifier(string keyIdentifier, string masterKeyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCspKeyIdSysErr : SR.TCE_InvalidCspKeyId; - return ADP.Argument(System.SRHelper.GetString(message, keyIdentifier, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCspKeyIdSysErr : Strings.TCE_InvalidCspKeyId; + return ADP.Argument(System.StringsHelper.GetString(message, keyIdentifier, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCngKey(string masterKeyPath, string cngProviderName, string keyIdentifier, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCngKeySysErr : SR.TCE_InvalidCngKey; - return ADP.Argument(System.SRHelper.GetString(message, masterKeyPath, cngProviderName, keyIdentifier), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCngKeySysErr : Strings.TCE_InvalidCngKey; + return ADP.Argument(System.StringsHelper.GetString(message, masterKeyPath, cngProviderName, keyIdentifier), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCertificateLocation(string certificateLocation, string certificatePath, string[] validLocations, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCertificateLocationSysErr : SR.TCE_InvalidCertificateLocation; - return ADP.Argument(System.SRHelper.GetString(message, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCertificateLocationSysErr : Strings.TCE_InvalidCertificateLocation; + return ADP.Argument(System.StringsHelper.GetString(message, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidCertificateStore(string certificateStore, string certificatePath, string validCertificateStore, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_InvalidCertificateStoreSysErr : SR.TCE_InvalidCertificateStore; - return ADP.Argument(System.SRHelper.GetString(message, certificateStore, certificatePath, validCertificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_InvalidCertificateStoreSysErr : Strings.TCE_InvalidCertificateStore; + return ADP.Argument(System.StringsHelper.GetString(message, certificateStore, certificatePath, validCertificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception EmptyCertificateThumbprint(string certificatePath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_EmptyCertificateThumbprintSysErr : SR.TCE_EmptyCertificateThumbprint; - return ADP.Argument(System.SRHelper.GetString(message, certificatePath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_EmptyCertificateThumbprintSysErr : Strings.TCE_EmptyCertificateThumbprint; + return ADP.Argument(System.StringsHelper.GetString(message, certificatePath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception CertificateNotFound(string thumbprint, string certificateLocation, string certificateStore, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_CertificateNotFoundSysErr : SR.TCE_CertificateNotFound; - return ADP.Argument(System.SRHelper.GetString(message, thumbprint, certificateLocation, certificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_CertificateNotFoundSysErr : Strings.TCE_CertificateNotFound; + return ADP.Argument(System.StringsHelper.GetString(message, thumbprint, certificateLocation, certificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } internal static Exception InvalidAlgorithmVersionInEncryptedCEK(byte actual, byte expected) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidAlgorithmVersionInEncryptedCEK, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidAlgorithmVersionInEncryptedCEK, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidCiphertextLengthInEncryptedCEK(int actual, int expected, string certificateName) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCiphertextLengthInEncryptedCEK, actual, expected, certificateName), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCiphertextLengthInEncryptedCEK, actual, expected, certificateName), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidCiphertextLengthInEncryptedCEKCsp(int actual, int expected, string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCiphertextLengthInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCiphertextLengthInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidCiphertextLengthInEncryptedCEKCng(int actual, int expected, string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCiphertextLengthInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCiphertextLengthInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidSignatureInEncryptedCEK(int actual, int expected, string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidSignatureInEncryptedCEK, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidSignatureInEncryptedCEK, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidSignatureInEncryptedCEKCsp(int actual, int expected, string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidSignatureInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidSignatureInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidSignatureInEncryptedCEKCng(int actual, int expected, string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidSignatureInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidSignatureInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidCertificateSignature(string certificatePath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCertificateSignature, certificatePath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCertificateSignature, certificatePath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception InvalidSignature(string masterKeyPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidSignature, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidSignature, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); } internal static Exception CertificateWithNoPrivateKey(string keyPath, bool isSystemOp) { - string message = isSystemOp ? SR.TCE_CertificateWithNoPrivateKeySysErr : SR.TCE_CertificateWithNoPrivateKey; - return ADP.Argument(System.SRHelper.GetString(message, keyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + string message = isSystemOp ? Strings.TCE_CertificateWithNoPrivateKeySysErr : Strings.TCE_CertificateWithNoPrivateKey; + return ADP.Argument(System.StringsHelper.GetString(message, keyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); } #endregion Always Encrypted - Certificate Store Provider Errors #region Always Encrypted - Cryptographic Algorithms Error messages internal static Exception NullPlainText() { - return ADP.ArgumentNull(System.SRHelper.GetString(SR.TCE_NullPlainText)); + return ADP.ArgumentNull(System.StringsHelper.GetString(Strings.TCE_NullPlainText)); } internal static Exception NullCipherText() { - return ADP.ArgumentNull(System.SRHelper.GetString(SR.TCE_NullCipherText)); + return ADP.ArgumentNull(System.StringsHelper.GetString(Strings.TCE_NullCipherText)); } internal static Exception NullColumnEncryptionAlgorithm(string supportedAlgorithms) { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, System.SRHelper.GetString(SR.TCE_NullColumnEncryptionAlgorithm, supportedAlgorithms)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, System.StringsHelper.GetString(Strings.TCE_NullColumnEncryptionAlgorithm, supportedAlgorithms)); } internal static Exception NullColumnEncryptionKeySysErr() { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTIONKEY, System.SRHelper.GetString(SR.TCE_NullColumnEncryptionKeySysErr)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTIONKEY, System.StringsHelper.GetString(Strings.TCE_NullColumnEncryptionKeySysErr)); } internal static Exception InvalidKeySize(string algorithmName, int actualKeylength, int expectedLength) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidKeySize, algorithmName, actualKeylength, expectedLength), TdsEnums.TCE_PARAM_ENCRYPTIONKEY); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidKeySize, algorithmName, actualKeylength, expectedLength), TdsEnums.TCE_PARAM_ENCRYPTIONKEY); } internal static Exception InvalidEncryptionType(string algorithmName, SqlClientEncryptionType encryptionType, params SqlClientEncryptionType[] validEncryptionTypes) { const string valueSeparator = @", "; - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidEncryptionType, algorithmName, encryptionType.ToString(), string.Join(valueSeparator, validEncryptionTypes.Select((validEncryptionType => @"'" + validEncryptionType + @"'")))), TdsEnums.TCE_PARAM_ENCRYPTIONTYPE); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidEncryptionType, algorithmName, encryptionType.ToString(), string.Join(valueSeparator, validEncryptionTypes.Select((validEncryptionType => @"'" + validEncryptionType + @"'")))), TdsEnums.TCE_PARAM_ENCRYPTIONTYPE); } internal static Exception InvalidCipherTextSize(int actualSize, int minimumSize) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCipherTextSize, actualSize, minimumSize), TdsEnums.TCE_PARAM_CIPHERTEXT); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCipherTextSize, actualSize, minimumSize), TdsEnums.TCE_PARAM_CIPHERTEXT); } internal static Exception InvalidAlgorithmVersion(byte actual, byte expected) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidAlgorithmVersion, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_CIPHERTEXT); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidAlgorithmVersion, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_CIPHERTEXT); } internal static Exception InvalidAuthenticationTag() { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidAuthenticationTag), TdsEnums.TCE_PARAM_CIPHERTEXT); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidAuthenticationTag), TdsEnums.TCE_PARAM_CIPHERTEXT); } #endregion Always Encrypted - Cryptographic Algorithms Error messages #region Always Encrypted - Errors from sp_describe_parameter_encryption internal static Exception UnexpectedDescribeParamFormatParameterMetadata() { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnexpectedDescribeParamFormatParameterMetadata, "sp_describe_parameter_encryption")); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnexpectedDescribeParamFormatParameterMetadata, "sp_describe_parameter_encryption")); } internal static Exception UnexpectedDescribeParamFormatAttestationInfo(string enclaveType) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnexpectedDescribeParamFormatAttestationInfo, "sp_describe_parameter_encryption", enclaveType)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnexpectedDescribeParamFormatAttestationInfo, "sp_describe_parameter_encryption", enclaveType)); } internal static Exception InvalidEncryptionKeyOrdinalEnclaveMetadata(int ordinal, int maxOrdinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_InvalidEncryptionKeyOrdinalEnclaveMetadata, ordinal, maxOrdinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_InvalidEncryptionKeyOrdinalEnclaveMetadata, ordinal, maxOrdinal)); } internal static Exception InvalidEncryptionKeyOrdinalParameterMetadata(int ordinal, int maxOrdinal) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_InvalidEncryptionKeyOrdinalParameterMetadata, ordinal, maxOrdinal)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_InvalidEncryptionKeyOrdinalParameterMetadata, ordinal, maxOrdinal)); } public static Exception MultipleRowsReturnedForAttestationInfo() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_MultipleRowsReturnedForAttestationInfo, "sp_describe_parameter_encryption")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_MultipleRowsReturnedForAttestationInfo, "sp_describe_parameter_encryption")); } internal static Exception ParamEncryptionMetadataMissing(string paramName, string procedureName) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_ParamEncryptionMetaDataMissing, "sp_describe_parameter_encryption", paramName, procedureName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_ParamEncryptionMetaDataMissing, "sp_describe_parameter_encryption", paramName, procedureName)); } internal static Exception ProcEncryptionMetadataMissing(string procedureName) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_ProcEncryptionMetaDataMissing, "sp_describe_parameter_encryption", procedureName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_ProcEncryptionMetaDataMissing, "sp_describe_parameter_encryption", procedureName)); } internal static Exception UnableToVerifyColumnMasterKeySignature(Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_UnableToVerifyColumnMasterKeySignature, innerException.Message), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_UnableToVerifyColumnMasterKeySignature, innerException.Message), innerException); } internal static Exception ColumnMasterKeySignatureVerificationFailed(string cmkPath) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_ColumnMasterKeySignatureVerificationFailed, cmkPath)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_ColumnMasterKeySignatureVerificationFailed, cmkPath)); } internal static Exception InvalidKeyStoreProviderName(string providerName, List systemProviders, List customProviders) @@ -1511,22 +1511,22 @@ internal static Exception InvalidKeyStoreProviderName(string providerName, List< const string valueSeparator = @", "; string systemProviderStr = string.Join(valueSeparator, systemProviders.Select(provider => $"'{provider}'")); string customProviderStr = string.Join(valueSeparator, customProviders.Select(provider => $"'{provider}'")); - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidKeyStoreProviderName, providerName, systemProviderStr, customProviderStr)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidKeyStoreProviderName, providerName, systemProviderStr, customProviderStr)); } internal static Exception ParamInvalidForceColumnEncryptionSetting(string paramName, string procedureName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_ParamInvalidForceColumnEncryptionSetting, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, paramName, procedureName, "SqlParameter")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_ParamInvalidForceColumnEncryptionSetting, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, paramName, procedureName, "SqlParameter")); } internal static Exception ParamUnExpectedEncryptionMetadata(string paramName, string procedureName) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_ParamUnExpectedEncryptionMetadata, paramName, procedureName, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, "SqlParameter")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_ParamUnExpectedEncryptionMetadata, paramName, procedureName, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, "SqlParameter")); } internal static Exception ColumnMasterKeySignatureNotFound(string cmkPath) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_ColumnMasterKeySignatureNotFound, cmkPath)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_ColumnMasterKeySignatureNotFound, cmkPath)); } #endregion Always Encrypted - Errors from sp_describe_parameter_encryption @@ -1534,42 +1534,42 @@ internal static Exception ColumnMasterKeySignatureNotFound(string cmkPath) internal static Exception ExceptionWhenGeneratingEnclavePackage(Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_ExceptionWhenGeneratingEnclavePackage, innerException.Message), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_ExceptionWhenGeneratingEnclavePackage, innerException.Message), innerException); } internal static Exception FailedToEncryptRegisterRulesBytePackage(Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_FailedToEncryptRegisterRulesBytePackage, innerException.Message), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_FailedToEncryptRegisterRulesBytePackage, innerException.Message), innerException); } internal static Exception InvalidKeyIdUnableToCastToUnsignedShort(int keyId, Exception innerException) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidKeyIdUnableToCastToUnsignedShort, keyId, innerException.Message), innerException); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidKeyIdUnableToCastToUnsignedShort, keyId, innerException.Message), innerException); } internal static Exception InvalidDatabaseIdUnableToCastToUnsignedInt(int databaseId, Exception innerException) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidDatabaseIdUnableToCastToUnsignedInt, databaseId, innerException.Message), innerException); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidDatabaseIdUnableToCastToUnsignedInt, databaseId, innerException.Message), innerException); } internal static Exception InvalidAttestationParameterUnableToConvertToUnsignedInt(string variableName, int intValue, string enclaveType, Exception innerException) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidAttestationParameterUnableToConvertToUnsignedInt, enclaveType, intValue, variableName, innerException.Message), innerException); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidAttestationParameterUnableToConvertToUnsignedInt, enclaveType, intValue, variableName, innerException.Message), innerException); } internal static Exception OffsetOutOfBounds(string argument, string type, string method) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_OffsetOutOfBounds, type, method)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_OffsetOutOfBounds, type, method)); } internal static Exception InsufficientBuffer(string argument, string type, string method) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InsufficientBuffer, argument, type, method)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InsufficientBuffer, argument, type, method)); } internal static Exception ColumnEncryptionKeysNotFound() { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_ColumnEncryptionKeysNotFound)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_ColumnEncryptionKeysNotFound)); } #endregion Always Encrypted - Errors from secure channel Communication @@ -1577,29 +1577,29 @@ internal static Exception ColumnEncryptionKeysNotFound() #region Always Encrypted - Errors when performing attestation internal static Exception AttestationInfoNotReturnedFromSqlServer(string enclaveType, string enclaveAttestationUrl) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_AttestationInfoNotReturnedFromSQLServer, enclaveType, enclaveAttestationUrl)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_AttestationInfoNotReturnedFromSQLServer, enclaveType, enclaveAttestationUrl)); } #endregion Always Encrypted - Errors when performing attestation #region Always Encrypted - Errors when establishing secure channel internal static Exception NullArgumentInConstructorInternal(string argumentName, string objectUnderConstruction) { - return ADP.ArgumentNull(argumentName, System.SRHelper.GetString(SR.TCE_NullArgumentInConstructorInternal, argumentName, objectUnderConstruction)); + return ADP.ArgumentNull(argumentName, System.StringsHelper.GetString(Strings.TCE_NullArgumentInConstructorInternal, argumentName, objectUnderConstruction)); } internal static Exception EmptyArgumentInConstructorInternal(string argumentName, string objectUnderConstruction) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_EmptyArgumentInConstructorInternal, argumentName, objectUnderConstruction)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_EmptyArgumentInConstructorInternal, argumentName, objectUnderConstruction)); } internal static Exception NullArgumentInternal(string argumentName, string type, string method) { - return ADP.ArgumentNull(argumentName, System.SRHelper.GetString(SR.TCE_NullArgumentInternal, argumentName, type, method)); + return ADP.ArgumentNull(argumentName, System.StringsHelper.GetString(Strings.TCE_NullArgumentInternal, argumentName, type, method)); } internal static Exception EmptyArgumentInternal(string argumentName, string type, string method) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_EmptyArgumentInternal, argumentName, type, method)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_EmptyArgumentInternal, argumentName, type, method)); } #endregion Always Encrypted - Errors when establishing secure channel @@ -1607,47 +1607,47 @@ internal static Exception EmptyArgumentInternal(string argumentName, string type internal static Exception CannotGetSqlColumnEncryptionEnclaveProviderConfig(Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_CannotGetSqlColumnEncryptionEnclaveProviderConfig, innerException.Message), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_CannotGetSqlColumnEncryptionEnclaveProviderConfig, innerException.Message), innerException); } internal static Exception CannotCreateSqlColumnEncryptionEnclaveProvider(string providerName, string type, Exception innerException) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_CannotCreateSqlColumnEncryptionEnclaveProvider, providerName, type, innerException.Message), innerException); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_CannotCreateSqlColumnEncryptionEnclaveProvider, providerName, type, innerException.Message), innerException); } internal static Exception SqlColumnEncryptionEnclaveProviderNameCannotBeEmpty() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_SqlColumnEncryptionEnclaveProviderNameCannotBeEmpty)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_SqlColumnEncryptionEnclaveProviderNameCannotBeEmpty)); } internal static Exception NoAttestationUrlSpecifiedForEnclaveBasedQuerySpDescribe(string enclaveType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_NoAttestationUrlSpecifiedForEnclaveBasedQuerySpDescribe, "sp_describe_parameter_encryption", enclaveType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_NoAttestationUrlSpecifiedForEnclaveBasedQuerySpDescribe, "sp_describe_parameter_encryption", enclaveType)); } internal static Exception NoAttestationUrlSpecifiedForEnclaveBasedQueryGeneratingEnclavePackage(string enclaveType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_NoAttestationUrlSpecifiedForEnclaveBasedQueryGeneratingEnclavePackage, enclaveType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_NoAttestationUrlSpecifiedForEnclaveBasedQueryGeneratingEnclavePackage, enclaveType)); } internal static Exception EnclaveTypeNullForEnclaveBasedQuery() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveTypeNullForEnclaveBasedQuery)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveTypeNullForEnclaveBasedQuery)); } internal static Exception EnclaveProvidersNotConfiguredForEnclaveBasedQuery() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveProvidersNotConfiguredForEnclaveBasedQuery)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveProvidersNotConfiguredForEnclaveBasedQuery)); } internal static Exception EnclaveProviderNotFound(string enclaveType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveProviderNotFound, enclaveType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveProviderNotFound, enclaveType)); } internal static Exception NullEnclaveSessionReturnedFromProvider(string enclaveType, string attestationUrl) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_NullEnclaveSessionReturnedFromProvider, enclaveType, attestationUrl)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_NullEnclaveSessionReturnedFromProvider, enclaveType, attestationUrl)); } #endregion Always Encrypted - Enclave provider/configuration errors @@ -1680,17 +1680,17 @@ internal static Exception GetExceptionArray(string serverName, string errorMessa internal static Exception ColumnDecryptionFailed(string columnName, string serverName, Exception e) { - return GetExceptionArray(serverName, System.SRHelper.GetString(SR.TCE_ColumnDecryptionFailed, columnName), e); + return GetExceptionArray(serverName, System.StringsHelper.GetString(Strings.TCE_ColumnDecryptionFailed, columnName), e); } internal static Exception ParamEncryptionFailed(string paramName, string serverName, Exception e) { - return GetExceptionArray(serverName, System.SRHelper.GetString(SR.TCE_ParamEncryptionFailed, paramName), e); + return GetExceptionArray(serverName, System.StringsHelper.GetString(Strings.TCE_ParamEncryptionFailed, paramName), e); } internal static Exception ParamDecryptionFailed(string paramName, string serverName, Exception e) { - return GetExceptionArray(serverName, System.SRHelper.GetString(SR.TCE_ParamDecryptionFailed, paramName), e); + return GetExceptionArray(serverName, System.StringsHelper.GetString(Strings.TCE_ParamDecryptionFailed, paramName), e); } #endregion Always Encrypted - Generic toplevel failures @@ -1698,17 +1698,17 @@ internal static Exception ParamDecryptionFailed(string paramName, string serverN internal static Exception UnknownColumnEncryptionAlgorithm(string algorithmName, string supportedAlgorithms) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnknownColumnEncryptionAlgorithm, algorithmName, supportedAlgorithms)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnknownColumnEncryptionAlgorithm, algorithmName, supportedAlgorithms)); } internal static Exception UnknownColumnEncryptionAlgorithmId(int algoId, string supportAlgorithmIds) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnknownColumnEncryptionAlgorithmId, algoId, supportAlgorithmIds), TdsEnums.TCE_PARAM_CIPHER_ALGORITHM_ID); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnknownColumnEncryptionAlgorithmId, algoId, supportAlgorithmIds), TdsEnums.TCE_PARAM_CIPHER_ALGORITHM_ID); } internal static Exception UnsupportedNormalizationVersion(byte version) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnsupportedNormalizationVersion, version, "'1'", "SQL Server")); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnsupportedNormalizationVersion, version, "'1'", "SQL Server")); } internal static Exception UnrecognizedKeyStoreProviderName(string providerName, List systemProviders, List customProviders) @@ -1716,12 +1716,12 @@ internal static Exception UnrecognizedKeyStoreProviderName(string providerName, const string valueSeparator = @", "; string systemProviderStr = string.Join(valueSeparator, systemProviders.Select(provider => @"'" + provider + @"'")); string customProviderStr = string.Join(valueSeparator, customProviders.Select(provider => @"'" + provider + @"'")); - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnrecognizedKeyStoreProviderName, providerName, systemProviderStr, customProviderStr)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnrecognizedKeyStoreProviderName, providerName, systemProviderStr, customProviderStr)); } internal static Exception InvalidDataTypeForEncryptedParameter(string parameterName, int actualDataType, int expectedDataType) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_NullProviderValue, parameterName, actualDataType, expectedDataType)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_NullProviderValue, parameterName, actualDataType, expectedDataType)); } internal static Exception KeyDecryptionFailed(string providerName, string keyHex, Exception e) @@ -1729,57 +1729,57 @@ internal static Exception KeyDecryptionFailed(string providerName, string keyHex if (providerName.Equals(SqlColumnEncryptionCertificateStoreProvider.ProviderName)) { - return GetExceptionArray(null, System.SRHelper.GetString(SR.TCE_KeyDecryptionFailedCertStore, providerName, keyHex), e); + return GetExceptionArray(null, System.StringsHelper.GetString(Strings.TCE_KeyDecryptionFailedCertStore, providerName, keyHex), e); } else { - return GetExceptionArray(null, System.SRHelper.GetString(SR.TCE_KeyDecryptionFailed, providerName, keyHex), e); + return GetExceptionArray(null, System.StringsHelper.GetString(Strings.TCE_KeyDecryptionFailed, providerName, keyHex), e); } } internal static Exception UntrustedKeyPath(string keyPath, string serverName) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UntrustedKeyPath, keyPath, serverName)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UntrustedKeyPath, keyPath, serverName)); } internal static Exception UnsupportedDatatypeEncryption(string dataType) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_UnsupportedDatatype, dataType)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_UnsupportedDatatype, dataType)); } internal static Exception ThrowDecryptionFailed(string keyStr, string valStr, Exception e) { - return GetExceptionArray(null, System.SRHelper.GetString(SR.TCE_DecryptionFailed, keyStr, valStr), e); + return GetExceptionArray(null, System.StringsHelper.GetString(Strings.TCE_DecryptionFailed, keyStr, valStr), e); } internal static Exception NullEnclaveSessionDuringQueryExecution(string enclaveType, string enclaveAttestationUrl) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_NullEnclaveSessionDuringQueryExecution, enclaveType, enclaveAttestationUrl)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_NullEnclaveSessionDuringQueryExecution, enclaveType, enclaveAttestationUrl)); } internal static Exception NullEnclavePackageForEnclaveBasedQuery(string enclaveType, string enclaveAttestationUrl) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_NullEnclavePackageForEnclaveBasedQuery, enclaveType, enclaveAttestationUrl)); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_NullEnclavePackageForEnclaveBasedQuery, enclaveType, enclaveAttestationUrl)); } internal static Exception EnclaveProviderNotFound(string enclaveType, string attestationProtocol) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveProviderNotFound, enclaveType, attestationProtocol)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveProviderNotFound, enclaveType, attestationProtocol)); } internal static Exception EnclaveTypeNotSupported(string enclaveType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveTypeNotSupported, enclaveType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveTypeNotSupported, enclaveType)); } internal static Exception AttestationProtocolNotSupportEnclaveType(string attestationProtocolStr, string enclaveType) { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_AttestationProtocolNotSupportEnclaveType, attestationProtocolStr, enclaveType)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_AttestationProtocolNotSupportEnclaveType, attestationProtocolStr, enclaveType)); } internal static Exception AttestationProtocolNotSpecifiedForGeneratingEnclavePackage() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_AttestationProtocolNotSpecifiedForGeneratingEnclavePackage)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_AttestationProtocolNotSpecifiedForGeneratingEnclavePackage)); } #endregion Always Encrypted - Client side query processing errors @@ -1788,27 +1788,27 @@ internal static Exception AttestationProtocolNotSpecifiedForGeneratingEnclavePac internal static Exception TceNotSupported() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_NotSupportedByServer, "SQL Server")); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_NotSupportedByServer, "SQL Server")); } internal static Exception EnclaveComputationsNotSupported() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveComputationsNotSupported)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveComputationsNotSupported)); } internal static Exception AttestationURLNotSupported() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_AttestationURLNotSupported)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_AttestationURLNotSupported)); } internal static Exception AttestationProtocolNotSupported() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_AttestationProtocolNotSupported)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_AttestationProtocolNotSupported)); } internal static Exception EnclaveTypeNotReturned() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_EnclaveTypeNotReturned)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_EnclaveTypeNotReturned)); } #endregion Always Encrypted - SQL connection related error messages @@ -1816,27 +1816,27 @@ internal static Exception EnclaveTypeNotReturned() internal static Exception CanOnlyCallOnce() { - return ADP.InvalidOperation(System.SRHelper.GetString(SR.TCE_CanOnlyCallOnce)); + return ADP.InvalidOperation(System.StringsHelper.GetString(Strings.TCE_CanOnlyCallOnce)); } internal static Exception NullCustomKeyStoreProviderDictionary() { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.SRHelper.GetString(SR.TCE_NullCustomKeyStoreProviderDictionary)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.StringsHelper.GetString(Strings.TCE_NullCustomKeyStoreProviderDictionary)); } internal static Exception InvalidCustomKeyStoreProviderName(string providerName, string prefix) { - return ADP.Argument(System.SRHelper.GetString(SR.TCE_InvalidCustomKeyStoreProviderName, providerName, prefix), TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS); + return ADP.Argument(System.StringsHelper.GetString(Strings.TCE_InvalidCustomKeyStoreProviderName, providerName, prefix), TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS); } internal static Exception NullProviderValue(string providerName) { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.SRHelper.GetString(SR.TCE_NullProviderValue, providerName)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.StringsHelper.GetString(Strings.TCE_NullProviderValue, providerName)); } internal static Exception EmptyProviderName() { - return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.SRHelper.GetString(SR.TCE_EmptyProviderName)); + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, System.StringsHelper.GetString(Strings.TCE_EmptyProviderName)); } #endregion Always Encrypted - Extensibility related error messages @@ -1850,7 +1850,7 @@ internal static string GetSNIErrorMessage(int sniError) Debug.Assert(sniError > 0 && sniError <= (int)SNINativeMethodWrapper.SniSpecialErrors.MaxErrorValue, "SNI error is out of range"); string errorMessageId = string.Format("SNI_ERROR_{0}", sniError); - return System.SRHelper.GetResourceString(errorMessageId); + return System.StringsHelper.GetResourceString(errorMessageId); } // Default values for SqlDependency and SqlNotificationRequest @@ -1875,123 +1875,123 @@ sealed internal class SQLMessage internal static string CultureIdError() { - return System.SRHelper.GetString(SR.SQL_CultureIdError); + return System.StringsHelper.GetString(Strings.SQL_CultureIdError); } internal static string EncryptionNotSupportedByClient() { - return System.SRHelper.GetString(SR.SQL_EncryptionNotSupportedByClient); + return System.StringsHelper.GetString(Strings.SQL_EncryptionNotSupportedByClient); } internal static string EncryptionNotSupportedByServer() { - return System.SRHelper.GetString(SR.SQL_EncryptionNotSupportedByServer); + return System.StringsHelper.GetString(Strings.SQL_EncryptionNotSupportedByServer); } internal static string OperationCancelled() { - return System.SRHelper.GetString(SR.SQL_OperationCancelled); + return System.StringsHelper.GetString(Strings.SQL_OperationCancelled); } internal static string SevereError() { - return System.SRHelper.GetString(SR.SQL_SevereError); + return System.StringsHelper.GetString(Strings.SQL_SevereError); } internal static string SSPIInitializeError() { - return System.SRHelper.GetString(SR.SQL_SSPIInitializeError); + return System.StringsHelper.GetString(Strings.SQL_SSPIInitializeError); } internal static string SSPIGenerateError() { - return System.SRHelper.GetString(SR.SQL_SSPIGenerateError); + return System.StringsHelper.GetString(Strings.SQL_SSPIGenerateError); } internal static string SqlServerBrowserNotAccessible() { - return System.SRHelper.GetString(SR.SQL_SqlServerBrowserNotAccessible); + return System.StringsHelper.GetString(Strings.SQL_SqlServerBrowserNotAccessible); } internal static string KerberosTicketMissingError() { - return System.SRHelper.GetString(SR.SQL_KerberosTicketMissingError); + return System.StringsHelper.GetString(Strings.SQL_KerberosTicketMissingError); } internal static string Timeout() { - return System.SRHelper.GetString(SR.SQL_Timeout_Execution); + return System.StringsHelper.GetString(Strings.SQL_Timeout_Execution); } internal static string Timeout_PreLogin_Begin() { - return System.SRHelper.GetString(SR.SQL_Timeout_PreLogin_Begin); + return System.StringsHelper.GetString(Strings.SQL_Timeout_PreLogin_Begin); } internal static string Timeout_PreLogin_InitializeConnection() { - return System.SRHelper.GetString(SR.SQL_Timeout_PreLogin_InitializeConnection); + return System.StringsHelper.GetString(Strings.SQL_Timeout_PreLogin_InitializeConnection); } internal static string Timeout_PreLogin_SendHandshake() { - return System.SRHelper.GetString(SR.SQL_Timeout_PreLogin_SendHandshake); + return System.StringsHelper.GetString(Strings.SQL_Timeout_PreLogin_SendHandshake); } internal static string Timeout_PreLogin_ConsumeHandshake() { - return System.SRHelper.GetString(SR.SQL_Timeout_PreLogin_ConsumeHandshake); + return System.StringsHelper.GetString(Strings.SQL_Timeout_PreLogin_ConsumeHandshake); } internal static string Timeout_Login_Begin() { - return System.SRHelper.GetString(SR.SQL_Timeout_Login_Begin); + return System.StringsHelper.GetString(Strings.SQL_Timeout_Login_Begin); } internal static string Timeout_Login_ProcessConnectionAuth() { - return System.SRHelper.GetString(SR.SQL_Timeout_Login_ProcessConnectionAuth); + return System.StringsHelper.GetString(Strings.SQL_Timeout_Login_ProcessConnectionAuth); } internal static string Timeout_PostLogin() { - return System.SRHelper.GetString(SR.SQL_Timeout_PostLogin); + return System.StringsHelper.GetString(Strings.SQL_Timeout_PostLogin); } internal static string Timeout_FailoverInfo() { - return System.SRHelper.GetString(SR.SQL_Timeout_FailoverInfo); + return System.StringsHelper.GetString(Strings.SQL_Timeout_FailoverInfo); } internal static string Timeout_RoutingDestination() { - return System.SRHelper.GetString(SR.SQL_Timeout_RoutingDestinationInfo); + return System.StringsHelper.GetString(Strings.SQL_Timeout_RoutingDestinationInfo); } internal static string Duration_PreLogin_Begin(long PreLoginBeginDuration) { - return System.SRHelper.GetString(SR.SQL_Duration_PreLogin_Begin, PreLoginBeginDuration); + return System.StringsHelper.GetString(Strings.SQL_Duration_PreLogin_Begin, PreLoginBeginDuration); } internal static string Duration_PreLoginHandshake(long PreLoginBeginDuration, long PreLoginHandshakeDuration) { - return System.SRHelper.GetString(SR.SQL_Duration_PreLoginHandshake, PreLoginBeginDuration, PreLoginHandshakeDuration); + return System.StringsHelper.GetString(Strings.SQL_Duration_PreLoginHandshake, PreLoginBeginDuration, PreLoginHandshakeDuration); } internal static string Duration_Login_Begin(long PreLoginBeginDuration, long PreLoginHandshakeDuration, long LoginBeginDuration) { - return System.SRHelper.GetString(SR.SQL_Duration_Login_Begin, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration); + return System.StringsHelper.GetString(Strings.SQL_Duration_Login_Begin, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration); } internal static string Duration_Login_ProcessConnectionAuth(long PreLoginBeginDuration, long PreLoginHandshakeDuration, long LoginBeginDuration, long LoginAuthDuration) { - return System.SRHelper.GetString(SR.SQL_Duration_Login_ProcessConnectionAuth, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration, LoginAuthDuration); + return System.StringsHelper.GetString(Strings.SQL_Duration_Login_ProcessConnectionAuth, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration, LoginAuthDuration); } internal static string Duration_PostLogin(long PreLoginBeginDuration, long PreLoginHandshakeDuration, long LoginBeginDuration, long LoginAuthDuration, long PostLoginDuration) { - return System.SRHelper.GetString(SR.SQL_Duration_PostLogin, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration, LoginAuthDuration, PostLoginDuration); + return System.StringsHelper.GetString(Strings.SQL_Duration_PostLogin, PreLoginBeginDuration, PreLoginHandshakeDuration, LoginBeginDuration, LoginAuthDuration, PostLoginDuration); } internal static string UserInstanceFailure() { - return System.SRHelper.GetString(SR.SQL_UserInstanceFailure); + return System.StringsHelper.GetString(Strings.SQL_UserInstanceFailure); } internal static string PreloginError() { - return System.SRHelper.GetString(SR.Snix_PreLogin); + return System.StringsHelper.GetString(Strings.Snix_PreLogin); } internal static string ExClientConnectionId() { - return System.SRHelper.GetString(SR.SQL_ExClientConnectionId); + return System.StringsHelper.GetString(Strings.SQL_ExClientConnectionId); } internal static string ExErrorNumberStateClass() { - return System.SRHelper.GetString(SR.SQL_ExErrorNumberStateClass); + return System.StringsHelper.GetString(Strings.SQL_ExErrorNumberStateClass); } internal static string ExOriginalClientConnectionId() { - return System.SRHelper.GetString(SR.SQL_ExOriginalClientConnectionId); + return System.StringsHelper.GetString(Strings.SQL_ExOriginalClientConnectionId); } internal static string ExRoutingDestination() { - return System.SRHelper.GetString(SR.SQL_ExRoutingDestination); + return System.StringsHelper.GetString(Strings.SQL_ExRoutingDestination); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs index 4d9c34247b..7a0e4620b2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -1381,9 +1381,9 @@ internal SqlError ProcessSNIError(TdsParserStateObject stateObj) string sniContextEnumName = TdsEnums.GetSniContextEnumName(stateObj.SniContext); - string sqlContextInfo = SRHelper.GetResourceString(sniContextEnumName); + string sqlContextInfo = StringsHelper.GetResourceString(sniContextEnumName); string providerRid = string.Format("SNI_PN{0}", details.provider); - string providerName = SRHelper.GetResourceString(providerRid); + string providerName = StringsHelper.GetResourceString(providerRid); Debug.Assert(!string.IsNullOrEmpty(providerName), $"invalid providerResourceId '{providerRid}'"); uint win32ErrorCode = details.nativeError; SqlClientEventSource.Log.AdvancedTraceEvent(" SNI Native Error Code = {0}", win32ErrorCode); @@ -5308,7 +5308,7 @@ private bool TryProcessRow(_SqlMetaDataSet columns, object[] buffer, int[] map, buffer[map[i]] = data.SqlValue; if (stateObj._longlen != 0) { - throw new SqlTruncateException(SRHelper.GetString(SR.SqlMisc_TruncationMaxDataMessage)); + throw new SqlTruncateException(StringsHelper.GetString(Strings.SqlMisc_TruncationMaxDataMessage)); } } data.Clear(); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs index 66c0966e7d..b2fa724102 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs @@ -907,7 +907,7 @@ private void ParseMultipartName() { if (null != _multipartName) { - string[] parts = MultipartIdentifier.ParseMultipartIdentifier(_multipartName, "[\"", "]\"", SR.SQL_TDSParserTableName, false); + string[] parts = MultipartIdentifier.ParseMultipartIdentifier(_multipartName, "[\"", "]\"", Strings.SQL_TDSParserTableName, false); _serverName = parts[0]; _catalogName = parts[1]; _schemaName = parts[2]; @@ -973,7 +973,7 @@ public static string GetProtocolWarning(this SslProtocols protocol) if ((protocol & (SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11)) != SslProtocols.None) #pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated { - message = SRHelper.Format(SR.SEC_ProtocolWarning, protocol.ToFriendlyName()); + message = StringsHelper.Format(Strings.SEC_ProtocolWarning, protocol.ToFriendlyName()); } return message; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs index 167954fbc0..78bdda5c7c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs @@ -1237,7 +1237,7 @@ internal bool SetPacketSize(int size) int remainingData = _inBytesRead - _inBytesUsed; if ((temp.Length < _inBytesUsed + remainingData) || (_inBuff.Length < remainingData)) { - string errormessage = SRHelper.GetString(SR.SQL_InvalidInternalPacketSize) + ' ' + temp.Length + ", " + _inBytesUsed + ", " + remainingData + ", " + _inBuff.Length; + string errormessage = StringsHelper.GetString(Strings.SQL_InvalidInternalPacketSize) + ' ' + temp.Length + ", " + _inBytesUsed + ", " + remainingData + ", " + _inBuff.Length; throw SQL.InvalidInternalPacketSize(errormessage); } Buffer.BlockCopy(temp, _inBytesUsed, _inBuff, 0, remainingData); @@ -2706,7 +2706,7 @@ public void ProcessSniPacket(PacketHandle packet, uint error) if (_inBuff.Length < dataSize) { Debug.Assert(true, "Unexpected dataSize on Read"); - throw SQL.InvalidInternalPacketSize(SRHelper.GetString(SR.SqlMisc_InvalidArraySizeMessage)); + throw SQL.InvalidInternalPacketSize(StringsHelper.GetString(Strings.SqlMisc_InvalidArraySizeMessage)); } _lastSuccessfulIOTimer._value = DateTime.UtcNow.Ticks; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs index a358992399..2e638a0502 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs @@ -427,7 +427,7 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion) } else { - throw new ArgumentException(SRHelper.Format(SRHelper.net_invalid_enum, nameof(NativeProtocols)), nameof(NativeProtocols)); + throw new ArgumentException(StringsHelper.Format(StringsHelper.net_invalid_enum, nameof(NativeProtocols)), nameof(NativeProtocols)); } return returnValue; } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.NetCoreApp.cs index b9308cbba6..fa86cd7954 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.NetCoreApp.cs @@ -35,7 +35,7 @@ public int EnclaveRetrySleepInSeconds { if (value < 1) { - throw new ArgumentException(SR.EnclaveRetrySleepInSecondsValueException); + throw new ArgumentException(Strings.EnclaveRetrySleepInSecondsValueException); } enclaveRetrySleepInSeconds = value; @@ -81,7 +81,7 @@ protected override byte[] MakeRequest(string url) } } - throw new AlwaysEncryptedAttestationException(String.Format(SR.GetAttestationSigningCertificateRequestFailedFormat, url, exception.Message), exception); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.GetAttestationSigningCertificateRequestFailedFormat, url, exception.Message), exception); } #endregion diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.NetCoreApp.cs index 207c5ef11a..1be443edbe 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.NetCoreApp.cs @@ -130,7 +130,7 @@ internal override void CreateEnclaveSession(byte[] attestationInfo, ECDiffieHell } else { - throw new AlwaysEncryptedAttestationException(SR.FailToCreateEnclaveSession); + throw new AlwaysEncryptedAttestationException(Strings.FailToCreateEnclaveSession); } } } @@ -175,7 +175,7 @@ private void VerifyAttestationInfo(string attestationUrl, HealthReport healthRep } else { - throw new AlwaysEncryptedAttestationException(String.Format(SR.VerifyHealthCertificateChainFormat, attestationUrl, chainStatus)); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.VerifyHealthCertificateChainFormat, attestationUrl, chainStatus)); } } } while (shouldRetryValidation); @@ -207,7 +207,7 @@ private X509Certificate2Collection GetSigningCertificate(string attestationUrl, } catch (CryptographicException exception) { - throw new AlwaysEncryptedAttestationException(String.Format(SR.GetAttestationSigningCertificateFailedInvalidCertificate, attestationUrl), exception); + throw new AlwaysEncryptedAttestationException(String.Format(Strings.GetAttestationSigningCertificateFailedInvalidCertificate, attestationUrl), exception); } rootSigningCertificateCache.Add(attestationUrl, certificateCollection, DateTime.Now.AddDays(1)); @@ -291,7 +291,7 @@ private void VerifyEnclaveReportSignature(EnclaveReportPackage enclaveReportPack if (calculatedSize != enclaveReportPackage.PackageHeader.PackageSize) { - throw new ArgumentException(SR.VerifyEnclaveReportFormatFailed); + throw new ArgumentException(Strings.VerifyEnclaveReportFormatFailed); } // IDK_S is contained in healthReport cert public key @@ -302,7 +302,7 @@ private void VerifyEnclaveReportSignature(EnclaveReportPackage enclaveReportPack if (!rsacng.VerifyData(enclaveReportPackage.ReportAsBytes, enclaveReportPackage.SignatureBlob, HashAlgorithmName.SHA256, RSASignaturePadding.Pss)) { - throw new ArgumentException(SR.VerifyEnclaveReportFailed); + throw new ArgumentException(Strings.VerifyEnclaveReportFailed); } } @@ -324,7 +324,7 @@ private void VerifyEnclavePolicy(EnclaveReportPackage enclaveReportPackage) // if (identity.Flags != ExpectedPolicy.Flags) { - throw new InvalidOperationException(SR.VerifyEnclaveDebuggable); + throw new InvalidOperationException(Strings.VerifyEnclaveDebuggable); } } @@ -333,7 +333,7 @@ private void VerifyEnclavePolicyProperty(string property, byte[] actual, byte[] { if (!actual.SequenceEqual(expected)) { - string exceptionMessage = String.Format(SR.VerifyEnclavePolicyFailedFormat, property, BitConverter.ToString(actual), BitConverter.ToString(expected)); + string exceptionMessage = String.Format(Strings.VerifyEnclavePolicyFailedFormat, property, BitConverter.ToString(actual), BitConverter.ToString(expected)); throw new ArgumentException(exceptionMessage); } } @@ -343,7 +343,7 @@ private void VerifyEnclavePolicyProperty(string property, uint actual, uint expe { if (actual < expected) { - string exceptionMessage = String.Format(SR.VerifyEnclavePolicyFailedFormat, property, actual, expected); + string exceptionMessage = String.Format(Strings.VerifyEnclavePolicyFailedFormat, property, actual, expected); throw new ArgumentException(exceptionMessage); } } @@ -356,7 +356,7 @@ private byte[] GetSharedSecret(EnclavePublicKey enclavePublicKey, EnclaveDiffieH RSACng rsacng = new RSACng(cngkey); if (!rsacng.VerifyData(enclaveDHInfo.PublicKey, enclaveDHInfo.PublicKeySignature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1)) { - throw new ArgumentException(SR.GetSharedSecretFailed); + throw new ArgumentException(Strings.GetSharedSecretFailed); } CngKey key = CngKey.Import(enclaveDHInfo.PublicKey, CngKeyBlobFormat.GenericPublicBlob); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs index 5ac0634202..fec2f1f768 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs @@ -450,13 +450,13 @@ static private string GetFullPathInternal(string path) path = path.Trim(); if (path.Length == 0) { - throw ADP.Argument(System.SRHelper.GetString(SR.SqlFileStream_InvalidPath), "path"); + throw ADP.Argument(System.StringsHelper.GetString(Strings.SqlFileStream_InvalidPath), "path"); } // make sure path is not DOS device path if (!path.StartsWith(@"\\") && !System.IO.PathInternal.IsDevice(path.AsSpan())) { - throw ADP.Argument(System.SRHelper.GetString(SR.SqlFileStream_InvalidPath), "path"); + throw ADP.Argument(System.StringsHelper.GetString(Strings.SqlFileStream_InvalidPath), "path"); } // normalize the path @@ -465,7 +465,7 @@ static private string GetFullPathInternal(string path) // make sure path is a UNC path if (System.IO.PathInternal.IsDeviceUNC(path.AsSpan())) { - throw ADP.Argument(System.SRHelper.GetString(SR.SqlFileStream_PathNotValidDiskResource), "path"); + throw ADP.Argument(System.StringsHelper.GetString(Strings.SqlFileStream_PathNotValidDiskResource), "path"); } return path; @@ -619,10 +619,10 @@ long allocationSize break; case Interop.Errors.ERROR_SHARING_VIOLATION: - throw ADP.InvalidOperation(System.SRHelper.GetString(SR.SqlFileStream_FileAlreadyInTransaction)); + throw ADP.InvalidOperation(System.StringsHelper.GetString(Strings.SqlFileStream_FileAlreadyInTransaction)); case Interop.Errors.ERROR_INVALID_PARAMETER: - throw ADP.Argument(System.SRHelper.GetString(SR.SqlFileStream_InvalidParameter)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.SqlFileStream_InvalidParameter)); case Interop.Errors.ERROR_FILE_NOT_FOUND: { @@ -655,7 +655,7 @@ long allocationSize if (Interop.Kernel32.GetFileType(hFile) != Interop.Kernel32.FileTypes.FILE_TYPE_DISK) { hFile.Dispose(); - throw ADP.Argument(System.SRHelper.GetString(SR.SqlFileStream_PathNotValidDiskResource)); + throw ADP.Argument(System.StringsHelper.GetString(Strings.SqlFileStream_PathNotValidDiskResource)); } // if the user is opening the SQL FileStream in read/write mode, we assume that they want to scan diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Resources/SR.Designer.cs b/src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.Designer.cs similarity index 99% rename from src/Microsoft.Data.SqlClient/netcore/src/Resources/SR.Designer.cs rename to src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.Designer.cs index 44caedd695..aa3f051d37 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Resources/SR.Designer.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.Designer.cs @@ -22,14 +22,14 @@ namespace System { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class SR { + internal class Strings { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal SR() { + internal Strings() { } /// @@ -39,7 +39,7 @@ internal class SR { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Data.SqlClient.Resources.SR", typeof(SR).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Data.SqlClient.Resources.Strings", typeof(Strings).Assembly); resourceMan = temp; } return resourceMan; @@ -1429,7 +1429,7 @@ internal class SR { } /// - /// Looks up a localized string similar to Security Warning: The negotiated '{0}' is an insecured protocol and is supported for backward compatibility only. The recommended protocol is TLS 1.2 and later.. + /// Looks up a localized string similar to Security Warning: The negotiated {0} is an insecure protocol and is supported for backward compatibility only. The recommended protocol version is TLS 1.2 and later.. /// internal static string SEC_ProtocolWarning { get { diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Resources/SR.resx b/src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.resx similarity index 100% rename from src/Microsoft.Data.SqlClient/netcore/src/Resources/SR.resx rename to src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.resx diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Resources/SRHelper.cs b/src/Microsoft.Data.SqlClient/netcore/src/Resources/StringsHelper.cs similarity index 89% rename from src/Microsoft.Data.SqlClient/netcore/src/Resources/SRHelper.cs rename to src/Microsoft.Data.SqlClient/netcore/src/Resources/StringsHelper.cs index baee5a3b65..1a12852bc7 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Resources/SRHelper.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Resources/StringsHelper.cs @@ -9,21 +9,21 @@ namespace System { - internal class SRHelper : SR + internal class StringsHelper : Strings { - static SRHelper loader = null; + static StringsHelper loader = null; ResourceManager resources; - internal SRHelper() + internal StringsHelper() { - resources = new ResourceManager("Microsoft.Data.SqlClient.Resources.SR", this.GetType().Assembly); + resources = new ResourceManager("Microsoft.Data.SqlClient.Resources.Strings", this.GetType().Assembly); } - private static SRHelper GetLoader() + private static StringsHelper GetLoader() { if (loader == null) { - SRHelper sr = new SRHelper(); + StringsHelper sr = new StringsHelper(); Interlocked.CompareExchange(ref loader, sr, null); } return loader; @@ -34,7 +34,7 @@ private static SRHelper GetLoader() public static ResourceManager Resources => GetLoader().resources; - // This method is used to decide if we need to append the exception message parameters to the message when calling SR.Format. + // This method is used to decide if we need to append the exception message parameters to the message when calling Strings.Format. // by default it returns false. // Native code generators can replace the value this returns based on user input at the time of native code generation. // Marked as NoInlining because if this is used in an AoT compiled app that is not compiled into a single file, the user @@ -48,13 +48,13 @@ private static bool UsingResourceKeys() public static string GetResourceString(string res) { - SRHelper sys = GetLoader(); + StringsHelper sys = GetLoader(); if (sys == null) return null; // If "res" is a resource id, temp will not be null, "res" will contain the retrieved resource string. // If "res" is not a resource id, temp will be null. - string temp = sys.resources.GetString(res, SRHelper.Culture); + string temp = sys.resources.GetString(res, StringsHelper.Culture); if (temp != null) res = temp; diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/AssemblyResourceManager.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/AssemblyResourceManager.cs index 357c45f82f..c277ca7da4 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/AssemblyResourceManager.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/AssemblyResourceManager.cs @@ -63,11 +63,7 @@ private bool TryGetResourceValue(string resourceName, object[] args, out object } else { -#if netcoreapp - var type = _resourceAssembly.GetType("System.SR"); -#else var type = _resourceAssembly.GetType("System.Strings"); -#endif var info = type.GetProperty(resourceName, BindingFlags.NonPublic | BindingFlags.Static); result = null;