private void AdjustOutputTypes() { // since MySQL likes to return user variables as strings // we reset the types of the readers internal value objects // this will allow those value objects to parse the string based // return values for (int i = 0; i < FieldCount; i++) { string fieldName = GetName(i); fieldName = fieldName.Remove(0, StoredProcedure.ParameterPrefix.Length + 1); MyCatParameter parameter = command.Parameters.GetParameterFlexible(fieldName, true); IMyCatValue v = MyCatField.GetIMyCatValue(parameter.MyCatDbType); if (v is MyCatBit) { MyCatBit bit = (MyCatBit)v; bit.ReadAsString = true; resultSet.SetValueObject(i, bit); } else { resultSet.SetValueObject(i, v); } } }
private static MyCatSchemaCollection GetDataTypes() { MyCatSchemaCollection dt = new MyCatSchemaCollection("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 MyCatBit.SetDSInfo(dt); MyCatBinary.SetDSInfo(dt); MyCatDateTime.SetDSInfo(dt); MyCatTimeSpan.SetDSInfo(dt); MyCatString.SetDSInfo(dt); MyCatDouble.SetDSInfo(dt); MyCatSingle.SetDSInfo(dt); MyCatByte.SetDSInfo(dt); MyCatInt16.SetDSInfo(dt); MyCatInt32.SetDSInfo(dt); MyCatInt64.SetDSInfo(dt); MyCatDecimal.SetDSInfo(dt); MyCatUByte.SetDSInfo(dt); MyCatUInt16.SetDSInfo(dt); MyCatUInt32.SetDSInfo(dt); MyCatUInt64.SetDSInfo(dt); return(dt); }