private static DataTypeDefinitionRow GetType(IColumn srcCol, DataTypeDefinitionDataTable types) { // DataTypeName=Hyperlink, DataTypeNameComplete=Text (255) String dataTypeNameComplete = srcCol.DataTypeNameComplete .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); String dataTypeName = srcCol.DataTypeName .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); if (dataTypeNameComplete.Length == 0) { dataTypeNameComplete = dataTypeName; } if (dataTypeName.Length == 0) { dataTypeName = dataTypeNameComplete; } int baseTypeId = srcCol.DataType; if (baseTypeId == 0) { baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeNameComplete); } if (baseTypeId == 0) { baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeName); } // include System.XXXX DataTypeDefinitionRow baseType = types.IncludeDataTypeDefinition(Mapping.GetSystemTypeFromOleDBTypeID(baseTypeId), null); string oleTypeName = (baseTypeId != 0) ? Mapping.GetOleDBTypeNameFromID(baseTypeId) : null; if (oleTypeName != null) { baseType = types.IncludeDataTypeDefinition("sql." + oleTypeName, baseType.DataTypeName); } if (dataTypeName.Length > 0) { baseType = types.IncludeDataTypeDefinition("sql." + dataTypeName, baseType.DataTypeName); } if (srcCol.CharacterMaxLength > 0) { dataTypeNameComplete += "_" + srcCol.CharacterMaxLength.ToString() + "_"; } baseType = types.IncludeDataTypeDefinition("app." + dataTypeNameComplete, baseType.DataTypeName); if (srcCol.CharacterMaxLength > 0) { baseType.StringSize = srcCol.CharacterMaxLength; } return(baseType); }
private static DataTypeDefinitionRow GetType(IColumn srcCol, DataTypeDefinitionDataTable types) { // DataTypeName=Hyperlink, DataTypeNameComplete=Text (255) String dataTypeNameComplete = srcCol.DataTypeNameComplete .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); String dataTypeName = srcCol.DataTypeName .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); if (dataTypeNameComplete.Length == 0) dataTypeNameComplete = dataTypeName; if (dataTypeName.Length == 0) dataTypeName = dataTypeNameComplete; int baseTypeId = srcCol.DataType; if (baseTypeId == 0) baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeNameComplete); if (baseTypeId == 0) baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeName); // include System.XXXX DataTypeDefinitionRow baseType = types.IncludeDataTypeDefinition(Mapping.GetSystemTypeFromOleDBTypeID(baseTypeId), null); string oleTypeName = (baseTypeId != 0) ? Mapping.GetOleDBTypeNameFromID(baseTypeId) : null; if (oleTypeName != null) baseType = types.IncludeDataTypeDefinition("sql." + oleTypeName, baseType.DataTypeName); if (dataTypeName.Length > 0) baseType = types.IncludeDataTypeDefinition("sql." + dataTypeName, baseType.DataTypeName); if (srcCol.CharacterMaxLength > 0) dataTypeNameComplete += "_" + srcCol.CharacterMaxLength.ToString() + "_"; baseType = types.IncludeDataTypeDefinition("app." + dataTypeNameComplete, baseType.DataTypeName); if (srcCol.CharacterMaxLength > 0) baseType.StringSize = srcCol.CharacterMaxLength; return baseType; }