dotConnect for Zoho CRM Documentation
Devart.Data.Zoho Namespace / ZohoException Class
Members Example

In This Topic
    ZohoException Class
    In This Topic
    The exception that is generated when Zoho CRM returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for Zoho CRM encounters an error generated by the server, or ZohoConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a ZohoException due to a non-existing table, and then displays the exception.
    public void ThrowZohoException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      ZohoConnection zohoConnection =
        new ZohoConnection(
            "API Version=V2;Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f3;ClientId=1000.M4FJLKYTSED90LJHUTVMKKAA432RUK;ClientSecret=89a0ed79957808814cdb20b9765423efffa767d1d0");
      ZohoCommand zohoCommand = new ZohoCommand(mySelectQuery,zohoConnection);
      try
      {
        zohoCommand.Connection.Open();
      }
      catch (ZohoException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowZohoException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim zohoConnection As New ZohoConnection( _
        "API Version=V2;Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f3;ClientId=1000.M4FJLKYTSED90LJHUTVMKKAA432RUK;ClientSecret=89a0ed79957808814cdb20b9765423efffa767d1d0")
      Dim zohoCommand As New ZohoCommand(mySelectQuery, zohoConnection)
      Try
        zohoCommand.Connection.Open()
      Catch myException As ZohoException
        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.Zoho.ZohoException

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also