dotConnect for BigCommerce Documentation
Devart.Data.Bigcommerce Namespace / BigcommerceException Class
Members Example

In This Topic
    BigcommerceException Class
    In This Topic
    The exception that is generated when BigCommerce returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for BigCommerce encounters an error generated by the server, or BigcommerceConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a BigcommerceException due to a non-existing table, and then displays the exception.
    public void ThrowBigcommerceException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      BigcommerceConnection bigcommerceConnection =
        new BigcommerceConnection(
            "Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;");
      BigcommerceCommand bigcommerceCommand = new BigcommerceCommand(mySelectQuery,bigcommerceConnection);
      try
      {
        bigcommerceCommand.Connection.Open();
      }
      catch (BigcommerceException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowBigcommerceException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim bigcommerceConnection As New BigcommerceConnection( _
        "Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;")
      Dim bigcommerceCommand As New BigcommerceCommand(mySelectQuery, bigcommerceConnection)
      Try
        bigcommerceCommand.Connection.Open()
      Catch myException As BigcommerceException
        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.Bigcommerce.BigcommerceException

    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