dotConnect for Mailchimp Documentation
Devart.Data.MailChimp Namespace / MailChimpException Class
Members Example

In This Topic
    MailChimpException Class
    In This Topic
    The exception that is generated when Mailchimp returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for Mailchimp encounters an error generated by the server, or MailChimpConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a MailChimpException due to a non-existing table, and then displays the exception.
    public void ThrowMailChimpException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      MailChimpConnection mailchimpConnection =
        new MailChimpConnection(
            "api key=8b10fe893c9732d12befe0b7d846ffcb-us10;");
      MailChimpCommand mailchimpCommand = new MailChimpCommand(mySelectQuery,mailchimpConnection);
      try
      {
        mailchimpCommand.Connection.Open();
      }
      catch (MailChimpException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowMailChimpException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim mailchimpConnection As New MailChimpConnection( _
        "api key=8b10fe893c9732d12befe0b7d846ffcb-us10;")
      Dim mailchimpCommand As New MailChimpCommand(mySelectQuery, mailchimpConnection)
      Try
        mailchimpCommand.Connection.Open()
      Catch myException As MailChimpException
        MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
      End Try
    End Sub
    Inheritance Hierarchy

    System.Object
       System.Exception
          System.SystemException
             System.Runtime.InteropServices.ExternalException
                System.Data.Common.DbException
                   Devart.Data.MailChimp.MailChimpException

    See Also