internal FdoSqlReader(ISQLDataReader reader) { _internalReader = reader; _ordinals = new Dictionary <string, int>(); int count = reader.GetColumnCount(); _types = new Type[count]; _names = new string[count]; _ptypes = new Dictionary <string, FdoPropertyType>(); List <string> geoms = new List <string>(); for (int i = 0; i < count; i++) { string name = _internalReader.GetColumnName(i); _names[i] = name; _ordinals.Add(name, i); PropertyType ptype = _internalReader.GetPropertyType(name); if (ptype == PropertyType.PropertyType_DataProperty) { _types[i] = ExpressUtility.GetClrTypeFromFdoDataType(_internalReader.GetColumnType(name)); _ptypes[name] = ValueConverter.FromDataType(_internalReader.GetColumnType(name)); } else if (ptype == PropertyType.PropertyType_GeometricProperty) { _types[i] = typeof(byte[]); geoms.Add(name); _ptypes[name] = FdoPropertyType.Geometry; } else if (ptype == PropertyType.PropertyType_AssociationProperty) { _ptypes[name] = FdoPropertyType.Association; } else if (ptype == PropertyType.PropertyType_ObjectProperty) { _ptypes[name] = FdoPropertyType.Object; } else if (ptype == PropertyType.PropertyType_RasterProperty) { _ptypes[name] = FdoPropertyType.Raster; } } _geometryNames = geoms.ToArray(); if (geoms.Count > 0) { _defaultGeometryName = geoms[0]; } }
internal FdoSqlReader(ISQLDataReader reader) { _internalReader = reader; _ordinals = new Dictionary<string, int>(); int count = reader.GetColumnCount(); _types = new Type[count]; _names = new string[count]; _ptypes = new Dictionary<string, FdoPropertyType>(); List<string> geoms = new List<string>(); for (int i = 0; i < count; i++) { string name = _internalReader.GetColumnName(i); _names[i] = name; _ordinals.Add(name, i); PropertyType ptype = _internalReader.GetPropertyType(name); if (ptype == PropertyType.PropertyType_DataProperty) { _types[i] = ExpressUtility.GetClrTypeFromFdoDataType(_internalReader.GetColumnType(name)); _ptypes[name] = ValueConverter.FromDataType(_internalReader.GetColumnType(name)); } else if (ptype == PropertyType.PropertyType_GeometricProperty) { _types[i] = typeof(byte[]); geoms.Add(name); _ptypes[name] = FdoPropertyType.Geometry; } else if (ptype == PropertyType.PropertyType_AssociationProperty) { _ptypes[name] = FdoPropertyType.Association; } else if (ptype == PropertyType.PropertyType_ObjectProperty) { _ptypes[name] = FdoPropertyType.Object; } else if (ptype == PropertyType.PropertyType_RasterProperty) { _ptypes[name] = FdoPropertyType.Raster; } } _geometryNames = geoms.ToArray(); if (geoms.Count > 0) _defaultGeometryName = geoms[0]; }
/// <summary> /// Gets the name of the column. /// </summary> /// <param name="index">The index.</param> /// <returns></returns> public virtual string GetColumnName(int index) { return(_internalReader.GetColumnName(index)); }