Beispiel #1
0
        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);
        }
        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);
        }