コード例 #1
0
        public IMySqlValue GetValueObject()
        {
            IMySqlValue v = GetIMySqlValue(Type);

            if (v is MySqlByte && ColumnLength == 1 && MaxLength == 1 && connection.Settings.TreatTinyAsBoolean)
            {
                MySqlByte b = (MySqlByte)v;
                b.TreatAsBoolean = true;
                v = b;
            }
            return(v);
        }
コード例 #2
0
        public sbyte GetSByte(int i)
        {
            IMySqlValue fieldValue = this.GetFieldValue(i, false);

            if (fieldValue is MySqlByte)
            {
                MySqlByte num = (MySqlByte)fieldValue;
                return(num.Value);
            }
            MySqlByte num2 = (MySqlByte)fieldValue;

            return(num2.Value);
        }
コード例 #3
0
        public override byte GetByte(int i)
        {
            IMySqlValue fieldValue = this.GetFieldValue(i, false);

            if (fieldValue is MySqlUByte)
            {
                MySqlUByte num = (MySqlUByte)fieldValue;
                return(num.Value);
            }
            MySqlByte num2 = (MySqlByte)fieldValue;

            return((byte)num2.Value);
        }
コード例 #4
0
ファイル: SchemaProvider.cs プロジェクト: sleepingwit/jal123
        private static MySqlSchemaCollection GetDataTypes()
        {
            MySqlSchemaCollection dt = new MySqlSchemaCollection("DataTypes");

            dt.AddColumn("TypeName", typeof(string));
            dt.AddColumn("ProviderDbType", typeof(int));
            dt.AddColumn("ColumnSize", typeof(long));
            dt.AddColumn("CreateFormat", typeof(string));
            dt.AddColumn("CreateParameters", typeof(string));
            dt.AddColumn("DataType", typeof(string));
            dt.AddColumn("IsAutoincrementable", typeof(bool));
            dt.AddColumn("IsBestMatch", typeof(bool));
            dt.AddColumn("IsCaseSensitive", typeof(bool));
            dt.AddColumn("IsFixedLength", typeof(bool));
            dt.AddColumn("IsFixedPrecisionScale", typeof(bool));
            dt.AddColumn("IsLong", typeof(bool));
            dt.AddColumn("IsNullable", typeof(bool));
            dt.AddColumn("IsSearchable", typeof(bool));
            dt.AddColumn("IsSearchableWithLike", typeof(bool));
            dt.AddColumn("IsUnsigned", typeof(bool));
            dt.AddColumn("MaximumScale", typeof(short));
            dt.AddColumn("MinimumScale", typeof(short));
            dt.AddColumn("IsConcurrencyType", typeof(bool));
            dt.AddColumn("IsLiteralSupported", typeof(bool));
            dt.AddColumn("LiteralPrefix", typeof(string));
            dt.AddColumn("LiteralSuffix", typeof(string));
            dt.AddColumn("NativeDataType", typeof(string));

            // have each one of the types contribute to the datatypes collection
            MySqlBit.SetDSInfo(dt);
            MySqlBinary.SetDSInfo(dt);
            MySqlDateTime.SetDSInfo(dt);
            MySqlTimeSpan.SetDSInfo(dt);
            MySqlString.SetDSInfo(dt);
            MySqlDouble.SetDSInfo(dt);
            MySqlSingle.SetDSInfo(dt);
            MySqlByte.SetDSInfo(dt);
            MySqlInt16.SetDSInfo(dt);
            MySqlInt32.SetDSInfo(dt);
            MySqlInt64.SetDSInfo(dt);
            MySqlDecimal.SetDSInfo(dt);
            MySqlUByte.SetDSInfo(dt);
            MySqlUInt16.SetDSInfo(dt);
            MySqlUInt32.SetDSInfo(dt);
            MySqlUInt64.SetDSInfo(dt);

            return(dt);
        }
コード例 #5
0
ファイル: Field.cs プロジェクト: Acettest/HUGAutoRegister
 public IMySqlValue GetValueObject()
 {
     IMySqlValue v = GetIMySqlValue(Type);
     if (v is MySqlByte && ColumnLength == 1 && driver.Settings.TreatTinyAsBoolean)
     {
         MySqlByte b = (MySqlByte)v;
         b.TreatAsBoolean = true;
         v = b;
     }
     else if (v is MySqlGuid)
     {
         MySqlGuid g = (MySqlGuid)v;
         g.OldGuids = driver.Settings.OldGuids;
         v = g;
     }
     return v;
 }
コード例 #6
0
        private static DataTable GetDataTypes()
        {
            DataTable dsTable = new DataTable("DataTypes");

            dsTable.Columns.Add(new DataColumn("TypeName", typeof(string)));
            dsTable.Columns.Add(new DataColumn("ProviderDbType", typeof(int)));
            dsTable.Columns.Add(new DataColumn("ColumnSize", typeof(long)));
            dsTable.Columns.Add(new DataColumn("CreateFormat", typeof(string)));
            dsTable.Columns.Add(new DataColumn("CreateParameters", typeof(string)));
            dsTable.Columns.Add(new DataColumn("DataType", typeof(string)));
            dsTable.Columns.Add(new DataColumn("IsAutoincrementable", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsBestMatch", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsCaseSensitive", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsFixedLength", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsFixedPrecisionScale", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsLong", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsNullable", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsSearchable", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsSearchableWithLike", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsUnsigned", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("MaximumScale", typeof(short)));
            dsTable.Columns.Add(new DataColumn("MinimumScale", typeof(short)));
            dsTable.Columns.Add(new DataColumn("IsConcurrencyType", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("IsLiteralsSupported", typeof(bool)));
            dsTable.Columns.Add(new DataColumn("LiteralPrefix", typeof(string)));
            dsTable.Columns.Add(new DataColumn("LiteralSuffix", typeof(string)));
            dsTable.Columns.Add(new DataColumn("NativeDataType", typeof(string)));
            MySqlBit.SetDSInfo(dsTable);
            MySqlBinary.SetDSInfo(dsTable);
            MySqlDateTime.SetDSInfo(dsTable);
            MySqlTimeSpan.SetDSInfo(dsTable);
            MySqlString.SetDSInfo(dsTable);
            MySqlDouble.SetDSInfo(dsTable);
            MySqlSingle.SetDSInfo(dsTable);
            MySqlByte.SetDSInfo(dsTable);
            MySqlInt16.SetDSInfo(dsTable);
            MySqlInt32.SetDSInfo(dsTable);
            MySqlInt64.SetDSInfo(dsTable);
            MySqlDecimal.SetDSInfo(dsTable);
            MySqlUByte.SetDSInfo(dsTable);
            MySqlUInt16.SetDSInfo(dsTable);
            MySqlUInt32.SetDSInfo(dsTable);
            MySqlUInt64.SetDSInfo(dsTable);
            return(dsTable);
        }
コード例 #7
0
        public IMySqlValue GetValueObject()
        {
            IMySqlValue mySqlValue = MySqlField.GetIMySqlValue(this.Type);

            if (mySqlValue is MySqlByte && this.ColumnLength == 1 && this.driver.Settings.TreatTinyAsBoolean)
            {
                MySqlByte mySqlByte = (MySqlByte)mySqlValue;
                mySqlByte.TreatAsBoolean = true;
                mySqlValue = mySqlByte;
            }
            else if (mySqlValue is MySqlGuid)
            {
                MySqlGuid mySqlGuid = (MySqlGuid)mySqlValue;
                mySqlGuid.OldGuids = this.driver.Settings.OldGuids;
                mySqlValue         = mySqlGuid;
            }
            return(mySqlValue);
        }
コード例 #8
0
        public IMySqlValue GetValueObject()
        {
            IMySqlValue iMySqlValue = GetIMySqlValue(this.Type);

            if (((iMySqlValue is MySqlByte) && (this.ColumnLength == 1)) && ((this.MaxLength == 1) && this.connection.Settings.TreatTinyAsBoolean))
            {
                MySqlByte num = (MySqlByte)iMySqlValue;
                num.TreatAsBoolean = true;
                return(num);
            }
            if ((this.Type == MySqlDbType.Binary) && (this.ColumnLength == 0x10))
            {
                MySqlBinary binary = (MySqlBinary)iMySqlValue;
                binary.IsGuid = true;
                iMySqlValue   = binary;
            }
            return(iMySqlValue);
        }
コード例 #9
0
ファイル: Field.cs プロジェクト: tmpkus/openvss
        public IMySqlValue GetValueObject()
        {
            IMySqlValue v = GetIMySqlValue(Type);

            if (v is MySqlByte && ColumnLength == 1 && MaxLength == 1 && connection.Settings.TreatTinyAsBoolean)
            {
                MySqlByte b = (MySqlByte)v;
                b.TreatAsBoolean = true;
                v = b;
            }
            else if (Type == MySqlDbType.Binary && ColumnLength == 16)
            {
                MySqlBinary b = (MySqlBinary)v;
                b.IsGuid = true;
                v        = b;
            }
            return(v);
        }