dotConnect for Magento Documentation
Devart.Data.Magento Namespace / MagentoException Class
Members Example

In This Topic
    MagentoException Class
    In This Topic
    The exception that is generated when Magento returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for Magento encounters an error generated by the server, or MagentoConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a MagentoException due to a non-existing table, and then displays the exception.
    public void ThrowMagentoException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      MagentoConnection magentoConnection =
        new MagentoConnection(
            "domain=192.168.10.68/magento;user=Test;apikey=testpassword;");
      MagentoCommand magentoCommand = new MagentoCommand(mySelectQuery,magentoConnection);
      try
      {
        magentoCommand.Connection.Open();
      }
      catch (MagentoException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowMagentoException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim magentoConnection As New MagentoConnection( _
        "domain=192.168.10.68/magento;user=Test;apikey=testpassword;")
      Dim magentoCommand As New MagentoCommand(mySelectQuery, magentoConnection)
      Try
        magentoCommand.Connection.Open()
      Catch myException As MagentoException
        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.Magento.MagentoException

    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