ServerAPI.SetDefaultCulture Method

Sets the default culture for a given user.

Public Sub SetDefaultCulture (domainAlias As System.String, _      culture As System.String)

[C#]
public SetDefaultCulture (System.String domainAlias,      System.String culture);

Parameters

  • domainAlias
    The domain and alias of the user whose default culture is being set, in the format "domain\user". For information about the maximum length of the domainAlias argument, see MapPoint Location Server Parameter Lengths.
  • culture
    The culture name in the format "languagecode2-regioncode2", where languagecode2 is a lowercase two-letter code derived from International Organization for Standardization (ISO) 639-1 and regioncode2 is an uppercase two-letter code derived from ISO 3166. For example, "en-US" denotes English (United States). For more information about supported cultures, see Valid Culture Names.

Remarks

The culture parameter must be set to a valid culture name in string format; for example, "en-US".

When this method is passed a user's domain and alias that are not valid (that does not exists in the enterprise), a UserNotProvisionedException is thrown.

When the method is passed a specific culture that is not valid (such as "en-XY") an InvalidCultureNameException is thrown.

When the method passed a neutral culture (such as "en" instead of "en-US") a NeutralCultureNameException is thrown.

Example

 
[Visual Basic]
    'Create a new instance of the ServerAPI class
    Dim MyServerAPI As New ServerAPI
    Try
        'Initialize the database connection for ServerAPI operations
        MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB")
        'Now Set the default culture for a user with domain alias DOMAIN\user
        MyServerAPI.SetDefaultCulture("DOMAIN\user", "en-US")
    Catch MyException As Exception
        'Process your exceptions here
        Console.WriteLine(MyException.GetType().Name)
    Finally
        'Do cleanup
        MyServerAPI = Nothing
    End Try

 
[C#]
  //Create a new instance of the ServerAPI class
  ServerAPI MyServerAPI = new ServerAPI();
  try
  {
   //Initialize the database connection for ServerAPI operations
   MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB");
   //Now set the default culture as "de-DE" for a user with domain alias DOMAIN\user
   MyServerAPI.SetDefaultCulture(@"DOMAIN\user", "de-DE");
  }
  catch(Exception MyException)
  {
   //Process your exceptions here
   Console.WriteLine(MyException.GetType().Name);
  }
  finally
  {
   //Do cleanup
   MyServerAPI = null;
  }

  
 

See Also

Microsoft.MapPoint.LocationServer.Management  |  ServerAPI Class  |  ServerAPI Members  |  ServerAPIException Class  |  Valid Culture Names