Пример #1
0
        internal static InvalidUdtException Create(Type udtType, string resourceReason)
        {
            string reason         = SRHelper.GetString(resourceReason);
            string message        = SRHelper.GetString(SR.SqlUdt_InvalidUdtMessage, udtType.FullName, reason);
            InvalidUdtException e = new InvalidUdtException(message);

            ADP.TraceExceptionAsReturnValue(e);
            return(e);
        }
Пример #2
0
 public static Exception InvalidOffsetLength()
 {
     return(_Argument(SRHelper.GetString(SR.Data_InvalidOffsetLength)));
 }
Пример #3
0
        internal static Normalizer GetNormalizer(Type t)
        {
            Normalizer n = null;

            if (t.IsPrimitive)
            {
                if (t == typeof(byte))
                {
                    n = new ByteNormalizer();
                }
                else if (t == typeof(sbyte))
                {
                    n = new SByteNormalizer();
                }
                else if (t == typeof(bool))
                {
                    n = new BooleanNormalizer();
                }
                else if (t == typeof(short))
                {
                    n = new ShortNormalizer();
                }
                else if (t == typeof(ushort))
                {
                    n = new UShortNormalizer();
                }
                else if (t == typeof(int))
                {
                    n = new IntNormalizer();
                }
                else if (t == typeof(uint))
                {
                    n = new UIntNormalizer();
                }
                else if (t == typeof(float))
                {
                    n = new FloatNormalizer();
                }
                else if (t == typeof(double))
                {
                    n = new DoubleNormalizer();
                }
                else if (t == typeof(long))
                {
                    n = new LongNormalizer();
                }
                else if (t == typeof(ulong))
                {
                    n = new ULongNormalizer();
                }
            }
            else if (t.IsValueType)
            {
                n = new BinaryOrderedUdtNormalizer(t, false);
            }
            if (n == null)
            {
                throw new Exception(SRHelper.GetString(SR.SQL_CannotCreateNormalizer, t.FullName));
            }
            n._skipNormalize = false;
            return(n);
        }
Пример #4
0
 private void DontDoIt()
 {
     throw new Exception(SRHelper.GetString(SR.Sql_InternalError));
 }