Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,6 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlDbTypeExtensions.cs">
<Link>Microsoft\Data\SqlDbTypeExtensions.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SQLResource.cs">
<Link>Microsoft\Data\SQLTypes\SQLResource.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs">
<Link>Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,6 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlFileStream.Windows.cs">
<Link>Microsoft\Data\SqlTypes\SqlFileStream.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SQLResource.cs">
<Link>Microsoft\Data\SqlTypes\SQLResource.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs">
<Link>Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ internal static AuthenticationException SSLCertificateAuthenticationException(st
internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, string value, string method)
=> ArgumentOutOfRange(StringsHelper.GetString(Strings.ADP_NotSupportedEnumerationValue, type.Name, value, method), type.Name);

internal static ArgumentOutOfRangeException InvalidArraySize(string parameterName) =>
ArgumentOutOfRange(StringsHelper.GetString(Strings.SqlMisc_InvalidArraySizeMessage), parameterName);

internal static void CheckArgumentNull(object value, string parameterName)
{
if (value is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ internal decimal Decimal
}
catch (OverflowException)
{
throw new OverflowException(SQLResource.ConversionOverflowMessage);
throw SQL.ConversionOverflow();
}
}
}
throw new OverflowException(SQLResource.ConversionOverflowMessage);
throw SQL.ConversionOverflow();
}
return new decimal(_value._numericInfo._data1, _value._numericInfo._data2, _value._numericInfo._data3, !_value._numericInfo._positive, _value._numericInfo._scale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,14 @@ internal static Exception UDTUnexpectedResult(string exceptionText)
return ADP.TypeLoad(StringsHelper.GetString(Strings.SQLUDT_Unexpected, exceptionText));
}

internal static Exception ConversionOverflow()
{
return new OverflowException(StringsHelper.GetString(Strings.SqlMisc_ConversionOverflowMessage));
}

internal static Exception DateTimeOverflow()
{
return new OverflowException(SqlTypes.SQLResource.DateTimeOverflowMessage);
return new OverflowException(StringsHelper.GetString(Strings.SqlMisc_DateTimeOverflowMessage));
}

//
Expand Down Expand Up @@ -2409,6 +2414,10 @@ internal static string ExRoutingDestination()
{
return StringsHelper.GetString(Strings.SQL_ExRoutingDestination);
}
internal static string NullString()
{
return StringsHelper.GetString(Strings.SqlMisc_NullString);
}
}

/// <summary>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private SqlVector(int length)
{
if (length < 0)
{
throw ADP.ArgumentOutOfRange(nameof(length), SQLResource.InvalidArraySizeMessage);
throw ADP.InvalidArraySize(nameof(length));
}

(_elementType, _elementSize) = GetTypeFieldsOrThrow();
Expand Down Expand Up @@ -92,7 +92,7 @@ internal string GetString()
{
if (IsNull)
{
return SQLResource.NullString;
return SQLMessage.NullString();
}
return JsonSerializer.Serialize(Memory);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void Construct_Length()
// to the same memory. We want to check memory content equality, so we
// compare their arrays instead.
Assert.Equal(new ReadOnlyMemory<float>().ToArray(), vec.Memory.ToArray());
Assert.Equal(SQLResource.NullString, vec.GetString());
Assert.Equal(SQLMessage.NullString(), vec.GetString());

var ivec = vec as ISqlVector;
Assert.Equal(0x00, ivec.ElementType);
Expand All @@ -59,7 +59,7 @@ public void Construct_WithLengthZero()
// to the same memory. We want to check memory content equality, so we
// compare their arrays instead.
Assert.Equal(new ReadOnlyMemory<float>().ToArray(), vec.Memory.ToArray());
Assert.Equal(SQLResource.NullString, vec.GetString());
Assert.Equal(SQLMessage.NullString(), vec.GetString());

var ivec = vec as ISqlVector;
Assert.Equal(0x00, ivec.ElementType);
Expand Down
Loading