ServerAPI.DeleteContact Method

Deletes the specified contact from contacts list of a given user.

Public Sub DeleteContact (domainAlias As System.String, _      contactDomainAlias As System.String)

[C#]
public DeleteContact (System.String domainAlias,      System.String contactDomainAlias);

Parameters

  • domainAlias
    The domain and alias of the user whose contact is being deleted, in the format "domain\user". For information about the maximum length of the domainAlias parameter, see MapPoint Location Server Parameter Lengths.
  • contactDomainAlias
    The domain and alias of the contact who is being deleted from the contact list. The contactDomainAlias parameter is required and must be in the format "domain\user". For information about the maximum length of the contactDomainAlias argument, see MapPoint Location Server Parameter Lengths.

Remarks

If the user specified by the domainalias parameter is not found in the MapPoint Location Server system, a UserNotProvisionedException exception is thrown.

If the contact specified in by the contactDomainAlias parameter is not found, a CallerSameAsContactException exception is thrown.

If the domainAlias parameter is the same as the contactDomainAlias parameter, a CallerSameAsContactException exception is thrown.

Example

 
[Visual Basic]
    'Microsoft SQL Server and database instance names 
    Const server As String = "Your SQL Server Name"
    Const database As String = "LocationServerDB"
    'Create a ServerAPI instance. 
    Dim MyServerAPI As New ServerAPI
    Try
        'Call initialize. 
        Call MyServerAPI.Initialize(server, database)
    Catch MyException As SqlConnectionFailedException
        'Your exception processing goes here. 
    End Try
    'If Initialize method call is successful...
    Dim MyDomainAlias As String = "DOMAIN\user"
    Dim DeleteContact As String = "DOMAIN\deletecontact"
    Try
        Call MyServerAPI.DeleteContact(MyDomainAlias, DeleteContact)
    Catch MyException As Exception
        'Your exception handling goes here. 
    End Try

 
[C#]
  //Set the computer running SQL Server and database instance names. 
  const string server = "Your SQL Server Name"; 
  const string database = "LocationServerDB"; 
  //Create a ServerAPI instance. 
  ServerAPI MyServerAPI = new ServerAPI(); 
  try 
  { 
   //Call initialize. 
   MyServerAPI.Initialize(server, database); 
  } 
  catch(SqlConnectionFailedException MyException) 
  { 
   //Your exception processing goes here. 
  } 
  //If Initialize method call is successful. 
  string MyDomainAlias = @"DOMAIN\user"; 
  string DeleteContact = @"DOMAIN\deletecontact"; 
  try
  { 
   MyServerAPI.DeleteContact(MyDomainAlias, DeleteContact); 
  } 
  catch(Exception MyException) 
  {
   //Exception handling goes here. 
  } 
   
  
 

See Also

Microsoft.MapPoint.LocationServer.Management  |  ServerAPI Class  |  ServerAPI Members  |  ServerAPIException Class