dotConnect for Snowflake Documentation
Devart.Data.Snowflake Namespace / SnowflakeException Class
Members Example

On this page
    SnowflakeException Class
    On this page
    The exception that is generated when Snowflake returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for Snowflake encounters an error generated by the server, or SnowflakeConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a SnowflakeException due to a non-existing table, and then displays the exception.
    public void ThrowSnowflakeException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      SnowflakeConnection snowflakeConnection =
        new SnowflakeConnection(
            "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********");
      SnowflakeCommand snowflakeCommand = new SnowflakeCommand(mySelectQuery,snowflakeConnection);
      try
      {
        snowflakeCommand.Connection.Open();
      }
      catch (SnowflakeException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowSnowflakeException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim snowflakeConnection As New SnowflakeConnection( _
        "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********")
      Dim snowflakeCommand As New SnowflakeCommand(mySelectQuery, snowflakeConnection)
      Try
        snowflakeCommand.Connection.Open()
      Catch myException As SnowflakeException
        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.Snowflake.SnowflakeException

    See Also