dotConnect for SQLite Documentation
Devart.Data.SQLite Namespace / SQLiteException Class
Members Example

In This Topic
    SQLiteException Class
    In This Topic
    The exception that is generated when SQLite returns an error.
    Syntax
    Remarks
    This class is created whenever dotConnect for SQLite encounters an error generated by the server, or SQLiteConnection has been closed before attempting to execute an operation on the server.
    Example
    The following example generates a SQLiteException due to a non-existing table, and then displays the exception.
    public void ThrowSQLiteException()
    {
      string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
      SQLiteConnection sqConnection =
        new SQLiteConnection(
            "DataSource=mydatabase.db;");
      SQLiteCommand sqCommand = new SQLiteCommand(mySelectQuery,sqConnection);
      try
      {
        sqCommand.Connection.Open();
      }
      catch (SQLiteException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowSQLiteException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim sqConnection As New SQLiteConnection( _
        "DataSource=mydatabase.db;")
      Dim sqCommand As New SQLiteCommand(mySelectQuery, sqConnection)
      Try
        sqCommand.Connection.Open()
      Catch myException As SQLiteException
        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.SQLite.SQLiteException

    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