A class that represents each subtype in a layer or table.






The array of FieldDomainInfo objects.



The description of the SubtypeCode.



The value stored in the database that is used to group a set of rows or features.


Subtypes are records in a table or feature class that have been grouped based on an attribute field. Subtypes are implemented by creating coded values and, therefore, are associated with fields of the data type short or long integer. These integer values each represent a feature in the subtype. For example, the following codes in a subtype named "WaterMains" could represent valid classes in a feature class for water mains:

  1. Transmission water mains
  2. Distribution water mains

Each subtype can also have its own attribute domain for a given field. Domain represents a set of or a range of values valid for a field. Domains can be of two types: (a) range domain or (b) coded domain. Use FieldDomainInfos properties to retrieve a list of fields that have domains assigned to. When the same domain is assigned to a given field for more than one subtypes, the domain information gets duplicated in FieldDomainInfo object for each subtype.



//get the service

wsmap.mapservice1_MapServer mapservice = new wsmap.mapservice1_MapServer();

mapservice.Url = "http://srver/ArcGIS/services/mapservice1/MapServer";


//get the server info

string mapname = mapservice.GetDefaultMapName();

MapServerInfo mapinfo = mapservice.GetServerInfo(mapname);


//subtypes information for a layer

//get the layer info from the server info

MapLayerInfo lyrinfo = mapinfo.MapLayerInfos[0];

//get the subtype info

SubtypeInfo[] subtypeinfos = lyrinfo.SubtypeInfos;

if (subtypeinfos.Length > 0)


      SubtypeInfo subtypeinfo = subtypeinfos[0];

      System.Diagnostics.Debug.WriteLine(subtypeinfo.SubtypeCode + ", " + subtypeinfo.SubtypeName);



//subtypes for a standalone table

//get the standalone table info from the server info if exist

StandaloneTableInfo[] stinfos = mapinfo.StandaloneTableInfos;

if (stinfos != null)

      StandaloneTableInfo stinfo = stinfos[0];

      SubtypeInfo[] stsubtypeinfos = stinfo.SubtypeInfos;

      SubtypeInfo stsubtypeinfo = stsubtypeinfos[0];

      System.Diagnostics.Debug.WriteLine(stsubtypeinfo.SubtypeCode + ", " + stsubtypeinfo.SubtypeName);