Introduction

SQLite ADO.NET Provider
SQLite.NET Class Library Documentation
See Also Example

About SQLite.NET

This class library is an ADO.NET wrapper around the popular (and free!) SQLite database engine. For information on SQL syntax, features of SQLite and a good understanding of how it works and what it does, I highly recommend heading over to sqlite.org and reading the documentation there.

The C# provider, the very minor C code modifications to SQLite, documentation and etc were written by Robert Simpson, and the SourceForge project page can be found here.

The System.Data.SQLite project is currently maintained by the SQLite Development Team and the latest source code and project information can be found here.

What's New?

Click here to see the version history of this SQLite.NET provider

Using this library

The following are links to information on various aspects of the library and how to use it in your application(s)

How to install Visual Studio Design-Time Support

How to configure and enumerate SQLite.NET through the DbProviderFactories object

Getting the best performance out of SQLite

Limitations of the SQLite.NET provider and the SQLite engine (compared to other providers and engines)

SQLite.NET Provider Features

This SQLite provider implements every feature of the underlying SQLite database engine without omission. Here's a brief summary:

  • Written from scratch on Visual Studio 2008 specifically for ADO.NET, implenting all the base classes and features recently introduced in the framework, including automatic transaction enlistment.
  • Supports the Full and Compact .NET Framework, as well as native C/C++ development. 100% binary compatible with the original sqlite3.dll.
  • Full support for Mono via a "managed only" provider that runs against the official SQLite 3.6.1 or higher library.
  • Full Entity Framework support (ADO.NET 3.5 SP1)
  • On the Compact Framework, it is faster than Sql Server Mobile. SQLite's installed size is a fraction of Sql Mobile's. It uses less memory at runtime, runs queries faster, and has a smaller database file size as well.
  • Encrypted database support. Encrypted databases are fully encrypted and support both binary and cleartext password types.
  • Visual Studio 2005/2008/2010/2012 Design-Time Support. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc.
  • Full SQLite schema editing inside Visual Studio. You can create/edit tables, views, triggers, indexes, check constraints and foreign keys.
  • Available as a single file redistributable (except Compact Framework). The core sqlite3 codebase and the ADO.NET wrapper are combined into one multi-module assembly.
  • Also available as separate native and managed assemblies and optionally with the Visual C++ Runtime statically linked.
  • Binaries included for Itanium, x64, x86 and ARM processors.
    Itanium processor support not currently included.
  • DbProviderFactory support.
  • Full support for ATTACH'ed databases. Exposed as Catalogs in the schema. When cloning a connection, all attached databases are automatically re-attached to the new connection.
  • DbConnection.GetSchema(...) support includes the MetaDataCollections, DataSourceInformation, Columns, Tables, Views, ViewColumns, Catalogs, Indexes, IndexColumns, ForeignKeys and Triggers.
  • Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace and detailed schema information even for complex queries.
  • Named and unnamed parameters.
  • Full UTF-8 and UTF-16 support, each with optimized pipelines into the native database core.
  • Multiple simultaneous DataReaders (one DataReader per Command however).
  • Full support for user-defined scalar and aggregate functions, encapsulated into an easy-to-use base class in which only a couple of overrides are necessary to implement new SQL functions.
  • Full support for user-defined collating sequences, every bit as simple to implement as user-defined functions and uses the same base class.
  • Full source for the entire engine and wrapper. No copyrights. Public Domain. 100% free for commercial and non-commercial use.

Distributing the Binaries (Desktop)

When using the mixed-mode assembly, the System.Data.SQLite.DLL file includes all the native and managed code. In that case, this is the only DLL required to be redistributed with your SQLite.NET application(s). When using separate native and managed assemblies, the System.Data.SQLite.DLL file contains all the managed code and the SQLite.Interop.DLL file contains all the native code. The native code comes in 3 flavors: Win32, Itanium and x64 (AMD64).
Itanium processor support not currently included.

Distributing the Binaries (Compact Framework)

Both the System.Data.SQLite.DLL and SQLite.Interop.XXX.DLL files must be deployed on the Compact Framework. The XXX is the build number of the System.Data.SQLite library (e.g. "085"). The SQLite.Interop.XXX.DLL file is a fully native assembly compiled for the ARM processor, and System.Data.SQLite is the fully-managed Compact Framework assembly.

Send comments on this topic.


Design-Time Support
SQLite.NET Class Library Documentation
See Also Example

Installing SQLite Visual Studio Design-Time Support

Supporting the Visual Studio query designer and allowing you to manipulate SQLite databases from within Visual Studio is a great time-saver. Though the support is not yet fully-implemented, there's certainly enough there to keep you busy. You can create databases, design and execute queries, create typed datasets and lots more all from Visual Studio.

Installation Instructions

Download and run one of the setup packages and then select the "Install the designer components for Visual Studio 20XX." option when prompted.

Express Edition Limitations

Visual Studio design-time Support, works with all versions of Visual Studio 2005/2008/2010/2012. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc.
Due to Visual Studio licensing restrictions, the Express Editions can no longer be supported.


DbProviderFactory Support
SQLite.NET Class Library Documentation
See Also Example

DbProviderFactories and You

One of the great new features of ADO.NET 2.0 is the use of reflection as a means of instantiating database providers programmatically. The information .NET uses to enumerate the available data providers in the system is relatively simple. It merely looks in the machine.config and in your own app.config file for some XML data to tell it what providers are installed and what assemblies those providers are in.

Scenario 1: Version Independent (does not use the Global Assembly Cache)

This method allows you to drop any new version of the System.Data.SQLite.DLL into your application's folder and use it without any code modifications or recompiling. Add the following code to your app.config file:

<configuration>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite"
           description=".Net Framework Data Provider for SQLite"
           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
    </DbProviderFactories>
  </system.data>
</configuration>

Scenario 2: Version Dependent, using either the DLL located in the same folder as the application or the Global Assembly Cache

This method expands on the above XML to provide the version number and key token of the SQLite DLL so it can be found either in the same folder as the application or looked up in the GAC. The downside to this method is that DbProviderFactories will use this version information to only load the version specified. This means if you update the DLL, you must also update this XML.

<configuration>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite"
           description=".Net Framework Data Provider for SQLite"
           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite,
                 Version=1.0.85.0, Culture=neutral,
                 PublicKeyToken=db937bc2d44ff139"/>
    </DbProviderFactories>
  </system.data>
</configuration>

The following C# code demonstrates instantiating SQLite through DbProviderFactories:

      DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite");
      using (DbConnection cnn = fact.CreateConnection())
      {
        cnn.ConnectionString = "Data Source=test.db3";
        cnn.Open();
      }


Environment Variables
SQLite.NET Class Library Documentation
See Also Example

These environment variables are used to control several features of the System.Data.SQLite library. All of these environment variables are optional.

None of these environment variables are supported by the Compact Framework builds of System.Data.SQLite, due to limitations imposed by the platform itself.

Name | Description
Force_SQLiteLog | If this environment variable is set [to anything], the SQLite logging subsystem may be initialized in a non-default application domain. By default, this is not allowed due to the potential for application domain unloading issues.
No_PreLoadSQLite | If this environment variable is set [to anything], the native library pre-loading functionality will be disabled. By default, the native library pre-loading will attempt to load the native SQLite library from architecture-specific (e.g. "x86", "amd64", "x64") or platform-specific (e.g. "Win32") directories that reside underneath the application base directory.
No_SQLiteFunctions | If this environment variable is set [to anything], the initial search for types in all loaded assemblies that are tagged with the SQLiteFunction attribute will be skipped. Normally, this search is conducted only once per application domain by the static constructor of the SQLiteFunction class; however, these implementation details are subject to change.
PreLoadSQLite_BaseDirectory | If this environment variable is set [to anything], it will be used instead of the application base directory by the native library pre-loader. This environment variable can be especially useful in ASP.NET and other hosted environments where direct control of the location of the managed assemblies is not under the control of the application.
PreLoadSQLite_ProcessorArchitecture | If this environment variable is set [to anything], it will be used instead of the processor architecture value contained in the PROCESSOR_ARCHITECTURE environment variable to help build the path of the native library to pre-load.
PreLoadSQLite_UseAssemblyDirectory | If this environment variable is set [to anything], the location of the currently executing assembly (i.e. the one containing all the managed components for System.Data.SQLite) will be used as the basis for locating the the native library to pre-load (i.e. instead of using the application domain base directory).
PROCESSOR_ARCHITECTURE | This environment variable is normally set by the operating system itself and should reflect the native processor architecture of the current process (e.g. a 32-bit x86 application running on a 64-bit x64 operating system should have the value "x86").


Optimizing Your Queries

Optimizing for SQLite
SQLite.NET Class Library Documentation
See Also Example

Tips on Optimizing Your Queries

The next few paragraphs will attempt to give you a few rudimentary rules for speeding up your queries in general, and especially how SQLite is adversely affected by the kinds of SQL behaviors you may have taken for granted in other providers. It is by no means a complete optimization guide. For even more details on optimizing your queries, visit sqlite.org.

The Importance of Transactions

If you are inserting data in SQLite without first starting a transaction: DO NOT PASS GO! Call BeginTransaction() right now, and finish with Commit()! If you think I'm kidding, think again. SQLite's A.C.I.D. design means that every single time you insert any data outside a transaction, an implicit transaction is constructed, the insert made, and the transaction destructed. EVERY TIME. If you're wondering why in the world your inserts are taking 100x longer than you think they should, look no further.

Prepared Statements

Lets have a quick look at the following code and evaluate its performance:

      using (SQLiteCommand mycommand = new SQLiteCommand(myconnection))
      {
        int n;

        for (n = 0; n < 100000; n ++)
        {
          mycommand.CommandText = String.Format("INSERT INTO [MyTable] ([MyId]) VALUES({0})", n + 1);
          mycommand.ExecuteNonQuery();
        }
      }

This code seems pretty tight, but if you think it performs well, you're dead wrong. Here's what's wrong with it:

  • I didn't start a transaction first! This insert is dog slow!
  • The CLR is calling "new" implicitly 100,000 times because I am formatting a string in the loop for every insert
  • Since SQLite precompiles SQL statements, the engine is constructing and deconstructing 100,000 SQL statements and allocating/deallocating their memory
  • All this construction and destruction is involving about 300,000 more native to managed interop calls than an optimized insert

So lets rewrite that code slightly:

      using (SQLiteTransaction mytransaction = myconnection.BeginTransaction())
      {
        using (SQLiteCommand mycommand = new SQLiteCommand(myconnection))
        {
          SQLiteParameter myparam = new SQLiteParameter();
          int n;

          mycommand.CommandText = "INSERT INTO [MyTable] ([MyId]) VALUES(?)";
          mycommand.Parameters.Add(myparam);

          for (n = 0; n < 100000; n ++)
          {
            myparam.Value = n + 1;
            mycommand.ExecuteNonQuery();
          }
        }
        mytransaction.Commit();
      }

Now this is a blazing fast insert for any database engine, not just SQLite. The SQL statement is prepared one time -- on the first call to ExecuteNonQuery(). Once prepared, it never needs re-evaluating. Furthermore, we're allocating no memory in the loop and doing a very minimal number of interop transitions. Surround the entire thing with a transaction, and the performance of this insert is so far and away faster than the original that it merits a hands-on-the-hips pirate-like laugh.

Every database engine worth its salt utilizes prepared statements. If you're not coding for this, you're not writing optimized SQL, and that's the bottom line.


Provider Limitations
SQLite.NET Class Library Documentation
See Also Example

Limitations of this ADO.NET SQLite Data Provider

As providers go, this one doesn't have many restrictions. SQLite has no support for row-level or table-level locks. When a connection locks the database for writing, no other connection or process may read or write to the database until the write operation is complete. The SQLite.NET provider attempts to retry internally if a database is locked, up to the CommandTimeout property of the command in question.

SQLite is inherently type-less, and only understands a few basic datatypes natively. They are (in .NET-speak) Int64, Double, String and Blob. The SQLite.NET provider will use the database schema information it can glean to enforce type-ness, but it is an inexact science.

Hierarchical DataReaders are not supported. In the case of transactions, any SQLiteCommand created on a connection will (when executed) automatically join a transaction in progress, regardless of whether that transaction was created before or after the command.

A SQLiteCommand object can be re-assigned a new SQLiteConnection object as long as no DataReaders are active on the command.

Opening a transaction is considered a write operation, so only use them when you want to write to the database! If you hold open a transaction, all readers on other connections will be blocked until the transaction is closed!

Thread Safety

Multi-threading in SQLite must be done carefully. Here are the restrictions:

  • You May Clone() a SQLiteConnection object in one thread and pass the cloned object to another thread. Once passed, the other thread becomes the new owner of the cloned connection, and the original thread must not keep a reference to the clone or call any methods on the clone.
  • You May create multiple threads, and those threads can create their own SQLiteConnection and subsequent objects for accessing a database. Multiple connections on multiple threads to the same database file are perfectly acceptable and will behave predictably.
  • You May NOT call methods or properties or otherwise reference any SQLite provider classes that belong to another thread.
  • You May NOT pass a SQLiteCommand, SQLiteDataReader, SQLiteDataAdapter or any other SQLite provider class except a cloned SQLiteConnection to another thread.

Understand again that SQLite has no fine-grained locking mechanisms. It is therefore your own responsibility in a multi-threaded environment to handle potential timeouts that may occur if a long-running query in one thread prevents a query in another thread from executing. These timeouts will only occur if one thread is attempting to read while another thread is attempting to write. Whichever thread got its lock first will be the one to execute, and the other thread will block until the CommandTimeout value elapses or the other thread finishes.


Version History
SQLite.NET Class Library Documentation
See Also Example

Version History

1.0.85.0 - April 18, 2013

  • Updated to SQLite 3.7.16.2.
  • Properly handle embedded NUL characters in parameter and column values. Fix for [3567020edf].
  • Make use of the sqlite3_prepare_v2 function when applicable.
  • Check for a valid row in the SQLiteDataReader.GetValue method.
  • Implement processor architecture detection when running on the .NET Compact Framework (via P/Invoke).
  • Support automated testing when running on the .NET Compact Framework 2.0.
  • Skip checking loaded assemblies for types tagged with the SQLiteFunction attribute when the No_SQLiteFunctions environment variable is set. Pursuant to [e4c8121f7b].
  • Add HexPassword connection string property to work around the inability to include a literal semicolon in a connection string property value. Pursuant to [1c456ae75f].
  • Add static Execute method to the SQLiteCommand class.
  • Support custom connection pool implementations by adding the ISQLiteConnectionPool interface, the static SQLiteConnection.ConnectionPool property, and the static CreateHandle method in addition to modifying the SQLiteConnectionPool class. Pursuant to [393d954be0].
  • Add public constructor to the SQLiteDataAdapter class that allows passing the parseViaFramework parameter to the SQLiteConnection constructor.
  • When built with the CHECK_STATE compile-time option, skip throwing exceptions from the SQLiteDataReader class when the object is being disposed.
  • Support automatic value conversions for columns with a declared type of BIGUINT, INTEGER8, INTEGER16, INTEGER32, INTEGER64, SMALLUINT, TINYSINT, UNSIGNEDINTEGER, UNSIGNEDINTEGER8, UNSIGNEDINTEGER16, UNSIGNEDINTEGER32, UNSIGNEDINTEGER64, INT8, INT16, INT32, INT64, UINT, UINT8, UINT16, UINT32, UINT64, or ULONG.
  • Add BindUInt32AsInt64 connection flag to force binding of UInt32 values as Int64 instead. Pursuant to [c010fa6584].
  • Add BindAllAsText and GetAllAsText connection flags to force binding and returning of all values as text.
  • Remove AUTOINCREMENT from the column type name map. ** Potentially Incompatible Change **
  • Avoid throwing overflow exceptions from the SQLite3.GetValue method for integral column types. Partial fix for [c010fa6584]. ** Potentially Incompatible Change **
  • Use the legacy connection closing algorithm when built with the INTEROP_LEGACY_CLOSE compile-time option.
  • Support using the directory containing the primary managed-only assembly as the basis for native library pre-loading.
  • Still further enhancements to the build and test automation.

1.0.84.0 - January 9, 2013

  • Updated to SQLite 3.7.15.2.
  • Explicitly dispose of all SQLiteCommand objects managed by the DbDataAdapter class. Fix for [6434e23a0f].
  • Add Cancel method to the SQLiteConnection class to interrupt a long running query.
  • Improve thread safety of the SQLiteLog.LogMessage method.

1.0.83.0 - December 29, 2012

  • Updated to SQLite 3.7.15.1.
  • Add Visual Studio 2012 support to all the applicable solution/project files, their associated supporting files, and the test suite.
  • Add Visual Studio 2012 support to the redesigned designer support installer.
  • Allow opened connections to skip adding the extension functions included in the interop assembly via the new NoExtensionFunctions connection flag.
  • Support loading of SQLite extensions via the new EnableExtensions and LoadExtension methods of the SQLiteConnection class. Pursuant to [17045010df].
  • Remove one set of surrounding single or double quotes from property names and values parsed from the connection string. Fix for [b4cc611998].
  • Modify parsing of connection strings to allow property names and values to be quoted. ** Potentially Incompatible Change **
  • Add ParseViaFramework property to the SQLiteConnection class to allow the built-in (i.e. framework provided) connection string parser to be used when opening a connection. Pursuant to [b4cc611998].
  • Add notifications before and after any connection is opened and closed, as well as other related notifications, via the new static Changed event.
  • Add an overload of the SQLiteLog.LogMessage method that takes a single string parameter.
  • Add an overload of the SQLiteConnection.LogMessage method that takes a SQLiteErrorCode parameter.
  • All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.
  • Make sure the error code of the SQLiteException class gets serialized.
  • Make the test project for the .NET Compact Framework more flexible.
  • When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.
  • The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. ** Potentially Incompatible Change **
  • The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. ** Potentially Incompatible Change **
  • The ErrorCode property of the SQLiteException is now an Int32, to allow the property inherited from the base class to be properly overridden. ** Potentially Incompatible Change **
  • The ErrorCode field of the LogEventArgs is now an object instead of an integer. ** Potentially Incompatible Change **
  • The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. ** Potentially Incompatible Change **
  • Implement more robust locking semantics for the CriticalHandle derived classes when compiled for the .NET Compact Framework.
  • Cache column indexes as they are looked up when using the SQLiteDataReader to improve performance.
  • Prevent the SQLiteConnection.Close method from throwing non-fatal exceptions during its disposal.
  • Rename the interop assembly functions sqlite3_cursor_rowid, sqlite3_context_collcompare, sqlite3_context_collseq, sqlite3_cursor_rowid, and sqlite3_table_cursor to include an "_interop" suffix. ** Potentially Incompatible Change **
  • Prevent the LastInsertRowId, MemoryUsed, and MemoryHighwater connection properties from throwing NotSupportedException when running on the .NET Compact Framework. Fix for [dd45aba387].
  • Improve automatic detection of the sqlite3_close_v2 function when compiled to use the standard SQLite library.
  • Add protection against ThreadAbortException asynchronously interrupting native resource initialization and finalization.
  • Add native logging callback for use with the sqlite3_log function to the interop assembly, enabled via the INTEROP_LOG preprocessor definition.
  • Add various diagnostic messages to the interop assembly, enabled via flags in the INTEROP_DEBUG preprocessor definition.
  • Further enhancements to the build and test automation.
  • Add test automation for the Windows CE binaries.

1.0.82.0 - September 3, 2012

  • Updated to SQLite 3.7.14.
  • Properly handle quoted data source values in the connection string. Fix for [8c3bee31c8].
  • The primary NuGet package now supports x86 / x64 and the .NET Framework 2.0 / 4.0 (i.e. in a single package).
  • Change the default value for the Synchronous connection string property to Full to match the default used by the SQLite core library itself. ** Potentially Incompatible Change **
  • Add the ability to skip applying default connection settings to opened databases via the new SetDefaults connection string property.
  • Add the ability to skip expanding data source file names to their fully qualified paths via the new ToFullPath connection string property.
  • Fix the database cleanup ordering in the tests for ticket [343d392b51].
  • Add support for the sqlite3_close_v2 function from the SQLite core library.
  • Add support for URI file names via the new FullUri connection string property.
  • Improve support for the standard SQLite core library in the LINQ assembly and the test suite.
  • Add SetMemoryStatus static method to the SQLiteConnection class.
  • Improve threaded handling of the delegate used by the SQLiteLog class.
  • Add define constants to support enabling or disabling individual groups of trace statements.

1.0.81.0 - May 27, 2012

  • Updated to SQLite 3.7.12.1.
  • Support compiling the interop assembly without support for the custom extension functions and the CryptoAPI based codec.
  • Add DefineConstants property to the SQLiteConnection class to return the list of define constants used when compiling the core managed assembly.
  • Add release archive verification tool to the release automation.
  • Fix NullReferenceException when calling the SQLiteDataAdapter.FillSchema method on a query that returns multiple result sets. Fix for [3aa50d8413].
  • Fix subtle race condition between threads fetching connection handles from the connection pool and any garbage collection (GC) threads that may be running. Fix for [996d13cd87].
  • Add missing call to SetTimeout in the SQLite3_UTF16.Open method.
  • Add checks to prevent the SQLiteConnectionPool.Remove method from returning any connection handles that are closed or invalid.
  • Modify static SQLiteBase helper methods to prevent them from passing IntPtr.Zero to the SQLite native library.
  • Remove static locks from the static helper methods in the SQLiteBase class, replacing them with a lock on the connection handle instance being operated upon.
  • Revise CriticalHandle derived classes to make them more thread-safe.
  • Add connection pool related diagnostic messages when compiled with the DEBUG define constant.
  • Add PoolCount property to the SQLiteConnection class to return the number of pool entries for the file name associated with the connection.
  • Rename internal SQLiteLastError methods to GetLastError.
  • Add assembly file test constraints to all tests that execute the "test.exe" or "testlinq.exe" files.

1.0.80.0 - April 1, 2012

  • Updated to SQLite 3.7.11.
  • In the SQLiteFunction class, when calling user-provided methods from a delegate called by native code, avoid throwing exceptions, optionally tracing the caught exceptions. Fix for [8a426d12eb].
  • Add Visual Studio 2005 support to all the applicable solution/project files, their associated supporting files, and the test suite.
  • Add Visual Studio 2005 support to the redesigned designer support installer.
  • Add experimental support for "pre-loading" the native SQLite library based on the processor architecture of the current process. This feature is now enabled by default at compile-time.
  • Add support for the native SQLite Online Backup API. Fix for [c71846ed57].
  • Acquire and hold a static data lock while checking if the native SQLite library has been initialized to prevent a subtle race condition that can result in superfluous error messages. Fix for [72905c9a77].
  • Support tracing of all parameter binding activity and use the connection flags to control what is traced.
  • When converting a DateTime instance of an "Unspecified" kind to a string, use the same kind as the connection, if available.
  • Add overload of the SQLiteDataReader.GetValues method that returns a NameValueCollection.
  • Add static ToUnixEpoch method to the SQLiteConvert class to convert a DateTime value to the number of whole seconds since the Unix epoch.
  • In the implicit conversion operators (to IntPtr) for both the SQLiteConnectionHandle and SQLiteStatementHandle classes, return IntPtr.Zero if the instance being converted is null.
  • Write warning message to the active trace listeners (for the Debug build configuration only) if a column type or type name cannot be mapped properly. See [4bbf851fa5].
  • When tracing SQL statements to be prepared, bypass the internal length limit of the sqlite3_log function by using the SQLiteLog class directly instead. Also, detect null and/or empty strings and emit a special message in that case.
  • For the setup, the Visual Studio task should only be initially checked if the GAC task is available and vice-versa.
  • Improve compatibility with custom command processors by using __ECHO instead of _ECHO in batch tools.
  • Add OpenAndReturn method to the SQLiteConnection class to open a connection and return it.
  • Add missing CheckDisposed calls to the SQLiteConnection class.
  • Add missing throw statement to the SQLiteConnection class.
  • Make sure the interop project uses /fp:precise for Windows CE.
  • Regenerate package load key to support loading the designer package into Visual Studio 2008 without having the matching SDK installed.
  • Modify transaction object disposal so that it can never cause an exception to be thrown.

1.0.79.0 - January 28, 2012

  • Use the WoW64 registry keys when installing the VS designer components on 64-bit Windows. Fix for [d8491abd0b].
  • Correct resource name used by the LINQ assembly to locate several key string resources. Fix for [fbebb30da9].

1.0.78.0 - January 27, 2012

  • Updated to SQLite 3.7.10.
  • Redesign the VS designer support installer and integrate it into the setup packages.
  • When emitting SQL for foreign keys in the VS designer, be sure to take all returned schema rows into account. Remainder of fix for [b226147b37].
  • Add Flags connection string property to control extra behavioral flags for the connection.
  • Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.
  • Even more enhancements to the build and test automation.
  • Support parameter binding to more primitive types, including unsigned integer types.
  • Recognize the TIMESTAMP column data type as the DateTime type. Fix for [bb4b04d457].
  • Prevent logging superfluous messages having to do with library initialization checking. Fix for [3fc172d1be].
  • Support the DateTimeKind and BaseSchemaName connection string properties in the SQLiteConnectionStringBuilder class. Fix for [f3ec1e0066].
  • Overloads of the SQLiteConvert.ToDateTime and SQLiteConvert.ToJulianDay methods that do not require an instance should be static. Partial fix for [4bbf851fa5]. ** Potentially Incompatible Change **

1.0.77.0 - November 28, 2011

  • Updated to SQLite 3.7.9.
  • More enhancements to the build and test automation.
  • Plug native memory leak when closing a database connection containing a statement that cannot be finalized for some reason.
  • The SQLite3 class should always attempt to dispose the contained SQLiteConnectionHandle, even when called via the finalizer.
  • When compiled with DEBUG defined, emit diagnostic information related to resource cleanup to any TraceListener objects that may be registered.
  • Stop characterizing all log messages as errors. From now on, if the errorCode is zero, the message will not be considered an error.
  • Never attempt to configure the native logging interface if the SQLite core library has already been initialized for the process. Fix for [2ce0870fad].
  • Allow the SQLiteLog class to be used for logging messages without having an open connection.
  • Support building the core System.Data.SQLite assemblies using the .NET Framework 4.0 Client Profile. Fix for [566f1ad1e4].
  • When generating the schema based on the contents of a SQLiteDataReader, skip flagging columns as unique if the data reader is holding the result of some kind of multi-table construct (e.g. a cross join) because we must allow duplicate values in that case. Fix for [7e3fa93744].
  • When returning schema information that may be used by the .NET Framework to construct dynamic SQL, use a fake schema name (instead of null) so that the table names will be properly qualified with the catalog name (i.e. the attached database name). Partial fix for [343d392b51].
  • Add SQLiteSourceId property to the SQLiteConnection class to return the SQLite source identifier.
  • Add MemoryUsed and MemoryHighwater properties to the SQLiteConnection class to help determine the memory usage of SQLite.
  • Add DateTimeKind connection string property to control the DateTimeKind of parsed DateTime values. Partial fix for [343d392b51]. ** Potentially Incompatible Change **
  • Improve the robustness of the SQLiteLog class when it will be initialized and unloaded multiple times.
  • Fix the name of the interop assembly for Windows CE. Add unit tests to prevent this type of issue from happening again. Fix for [737ca4ff74].
  • Formally support the SQL type name BOOLEAN in addition to BOOL. Fix for [544dba0a2f].
  • Make sure the SQLiteConvert.TypeNameToDbType method is thread-safe. Fix for [84718e79fa].

1.0.76.0 - October 4, 2011

  • Prevent the domain unload event handler in SQLiteLog from being registered multiple times. Fix for [0d5b1ef362].
  • Stop allowing non-default application domains to initialize the SQLiteLog class. Fix for [ac47dd230a].

1.0.75.0 - October 3, 2011

  • Updated to SQLite 3.7.8.
  • More enhancements to the build system.
  • Add official NuGet packages for x86 and x64.
  • Add Changes and LastInsertRowId properties to the connection class.
  • Support more formats when converting data from/to the DateTime type.
  • Make all the assembly versioning attributes consistent.
  • Add unit testing infrastructure using Eagle.
  • Integrate all legacy unit tests, including the "testlinq" project, into the new test suite.
  • Add projects to build the interop assembly statically linked to the Visual C++ runtime. Fix for [53f0c5cbf6].
  • Add SQLITE_ENABLE_STAT2 compile-time option to the interop assembly. Fix for [74807fbf27].
  • Fix mutex issues exposed when running the test suite with the debug version of SQLite.
  • Fix transaction enlistment when repeated attempts are made to enlist in the same transaction. Fix for [ccfa69fc32].
  • Support the SQLITE_FCNTL_WIN32_AV_RETRY file control to mitigate the impact of file sharing violations caused by external processes.
  • Refactor the logging interface to be thread-safe and self-initializing.
  • Shutdown the SQLite native interface when the AppDomain is being unloaded. Fix for [b4a7ddc83f].
  • Support Skip operation for LINQ using OFFSET. Fix for [8b7d179c3c].
  • Support EndsWith operation for LINQ using SUBSTR. Fix for [59edc1018b].
  • Support all SQLite journal modes. Fix for [448d663d11].
  • Do not throw exceptions when disposing SQLiteDataReader. Fix for [e1b2e0f769].
  • The REAL type should be mapped to System.Double. Fix for [2c630bffa7] and [b0a5990f48].
  • Minor optimization to GetParamValueBytes(). Fix for [201128cc88].
  • Support the ON UPDATE, ON DELETE, and MATCH clause information when generating schema metadata for foreign keys. Partial fix for [b226147b37]. VS designer changes are not yet tested.
  • Fix incorrect resource name for SR.resx in the mixed-mode assembly.
  • Reduce the number of String.Compare() calls in the hot path for SQLiteCommand.ExecuteReader().

1.0.74.0 - July 4, 2011

  • Updated to SQLite 3.7.7.1.
  • Fix incorrect hard-coded .NET Framework version information SQLiteFactory_Linq.cs that was causing IServiceProvider.GetService to fail when running against the .NET Framework 3.5.
  • Fix all XML documentation warnings.
  • Restore support for the mixed-mode assembly (i.e. the one that can be registered in the Global Assembly Cache).
  • Restore support for the Compact Framework.
  • Remove unused "using" statements from the System.Data.SQLite and System.Data.SQLite.Linq projects.
  • Remove hard-coded System.Data.SQLite.Linq version from SQLiteFactory_Linq.cs
  • Modify the setup to support bundled packages (i.e. with the mixed-mode assembly) and standard packages (i.e. with the managed assembly separate from the native interop library).
  • Disable the ability to register with the Global Assembly Cache in the standard setup package (i.e. it is available in the bundled setup only).
  • Remove PATH modification from the setup.
  • Modify the naming scheme for the source, setup, and binary packages to allow for the necessary variants.
  • In the build automation, attempt to automatically detect if Visual Studio 2008 and/or 2010 are installed and support building binaries for both at once, when available.
  • Add release automation to build the source, setup, and binary packages in all supported build variants.
  • Add the testlinq project to the new build system and make it work properly with Visual Studio 2008 and 2010.

1.0.73.0 - June 2, 2011

  • Updated to SQLite 3.7.6.3.
  • Minor optimization to GetBytes(). Fix for [8c1650482e].
  • Update various assembly information settings.
  • Correct System.Data.SQLite.Linq version and resource information. Fix for [6489c5a396] and [133daf50d6].
  • Moved log handler from SQLiteConnection object to SQLiteFactory object to prevent if from being prematurely GCed.
  • We should block x64 installs on x86 and we should install native only if the setup package itself is native. Fix for [e058ce156e].

1.0.72.0 - May 1, 2011

  • Add the correct directory to the path. Fix for [50515a0c8e].

1.0.71.0 - April 27, 2011

  • Updated to SQLite 3.7.6+ [1bd1484cd7] to get additional Windows error logging.
  • Updated setup to optionally add install directory to PATH if GAC option selected.

1.0.70.0 - April 22, 2011

  • Added support for sqlite3_extended_result_codes(), sqlite3_errcode(), and sqlite3_extended_errcode() via SetExtendedResultCodes(), ResultCode(), and ExtendedResultCode().
  • Added support for SQLITE_CONFIG_LOG via SQLiteLogEventHandler().

1.0.69.0 - April 12, 2011

  • Code merge with SQLite 3.7.6.
  • New VS2008 and VS2010 solution files.
  • Build and packaging automation.
  • New Inno Setup files.
  • Designer support currently not ready for release.

1.0.68.0 - February 2011

  • Code merge with SQLite 3.7.5.
  • Continuing work on supporting Visual Studio 2010.

1.0.67.0 - January 3, 2011

  • Code merge with SQLite 3.7.4.
  • Continuing work on supporting Visual Studio 2010.

1.0.66.1 - August 1, 2010

  • Code merge with SQLite 3.7.0.1
  • Re-enabled VS2005 designer support, broken in previous versions during the 2008 transition
  • Implemented new forms of Take/Skip in the EF framework courtesy jlsantiago
  • Added "Foreign Keys" to the connection string parameters
  • Added the Truncate option to the Journal Modes enumeration

1.0.66.0 - April 18, 2010

  • Code merge with SQLite 3.6.23.1
  • Fixed a bug in the installer that accidentally modified the machine.config on .NET versions prior to 2.0, invaliding the config file.
  • Fixed INTERSECT and EXCEPT union query generation in EF
  • Fixed an out of memory error in the trigger designer in cases where a WHEN clause is used in the trigger

1.0.65.0 - July 26, 2009

  • Fixed a bug in the encryption module to prevent a double free() when rekeying a database.
  • Fixed a bug in the encryption module when ATTACHing an encrypted database.
  • Incorporated the WinCE locking fix from ticket #3991
  • Added "bigint" to the dropdown in the table designer, plus other minor table designer bugfixes.

1.0.64.0 - July 9, 2009

  • Fixed the missing resources problem from the 63 release.
  • Added preliminary support for the Visual Studio 2010 beta.
  • Fixed a bug in SQLiteCommand that threw a null reference exception when setting the Transaction object to null.
  • If SQLiteConnection.EnlistTransaction is called multiple times for the same transaction scope, just return without throwing an error.

1.0.63.0 - June 29, 2009

  • Code merge with SQLite 3.6.16
  • Check the autocommit mode of the connection to which a transaction is bound during the disposal of the transaction. If autocommit is enabled, then the database has already rolled back the transaction and we don't need to do it during dispose, and can quietly ignore the step without throwing an error.
  • Eliminated the mergebin step altogether. It was developed primarily to merge the Compact Framework binaries together, but since we're not doing that anymore, its use is limited. Its non-standard method of merging a binary on the desktop framework is redundant as well. The desktop binary now hard-links to MSCOREE, but as of Windows XP, this was redundant as well since XP and beyond automatically attempt to load MSCOREE on startup when a DLL has a .NET header.
  • More improvements to the test.exe program for running the tests against Sql Server for comparison purposes.

1.0.62.0 - June 20, 2009

  • Code merge with SQLite 3.6.15
  • Fixed the decimal reading bug in the SQLiteDataReader
  • Changed Join()'s to Sleep()'s in the statement retry code to prevent message pumping
  • Fixed a bad pointer conversion when retrieving blobs using GetBytes() in 64-bit land
  • Several changes to the Test program that comes with the provider. Tests can now be individually disabled, and the test program can run against several provider back-ends

1.0.61.0 - April 28, 2009

  • Code merge with SQLite 3.6.13. The new backup features are as yet unimplemented in the provider, but will be forthcoming in a subsequent release
  • Fixed the default-value lookups in SQLiteConnectionStringBuilder when accessing properties
  • Lock the SQLiteTransaction object during dispose to avoid potential race condition during cleanup
  • Fixed SQLiteDataReader.GetDecimal() processing and parsing of decimal values for cases when SQLite returns things like "1.0e-05" instead of "0.0001"

1.0.60.0 - October 3, 2008

  • Throw a NotSupported exception in the EF Sql Gen code instead of parsing illegal SQL during an update/insert/delete where no primary key is defined.
  • Fixed the Compact Framework interop library. Since the linker flag /subsystem had no version specified, it was causing a problem for many CE-based platforms.
  • Incorporated SQLite patch for ticket #3387 and reverted out the vfs override code I added in build 59 to work around this problem.
  • Fixed a designer issue when creating a new table from the Server Explorer. After initially saving it, if you then continued to edit it and tried to save it again, it would generate the change SQL using the old temporary table name rather than the new name.

1.0.59.0 - September 22, 2008

  • Code merge with SQLite 3.6.3. Solves a couple different EF issues that were either giving inconsistent results or crashing the engine.
  • Fixed the parsing of literal binaries in the EF SqlGen code. SQLite now passes nearly all the testcases in Microsoft's EF Query Samples application -- the exception being the datetimeoffset and time constants tests, and tests that use the APPLY keyword which are unsupported for now.
  • Revamped the Compact Framework mixed-mode assembly. Tired of playing cat and mouse with the Compact Framework's support for mixed-mode assemblies. The CF build now requires that you distribute both the System.Data.SQLite library and the paired SQLite.Interop.XXX library. The XXX denotes the build number of the library.
  • Implemented a workaround for Vista's overzealous caching by turning off FILE_FLAG_RANDOM_ACCESS for OS versions above XP. This is implemented as a custom (default override) VFS in the interop.c file, so no changes are made to the SQLite source code.
  • Fixed some registry issues in the designer install.exe, which prevented some design-time stuff from working on the Compact Framework when .NET 3.5 was installed.

1.0.58.0 - August 30, 2008

  • Code merge with SQLite 3.6.2. If only I'd waited one more day to release 57! Several LINQ issues have been resolved with this engine release relating to deeply-nested subqueries that the EF SqlGen creates.
  • Fixed the Rollback SQLiteConnection event to not require a connection be opened first.

1.0.57.0 - August 29, 2008

  • Compiled against 3.6.1 with checkin #3300 resolved, which fixes an Entity Framework bug I was seeing. I currently have 3 other tickets out on the engine, which are not yet resolved and relate to EF.
  • Fixed decimal types to store and fetch using InvariantCulture. If you're using decimal datatypes in your database and were affected by the 56 release, please issue an UPDATE <table> SET <column> = REPLACE(<column>, ',', '.'); to fix the decimal separators. Apologies for not testing that more thoroughly before releasing 56.
  • Too many LINQ fixes to list. Fixed views so they generate, fixed the LIMIT clause, implemented additional functionality and removed unnecessary code.
  • Fixed foreign key names in the designer so viewing the SQL script on a new unsaved table after renaming it in the properties toolwindow will reflect in the script properly.
  • Fixed the Update and Commit events on SQLiteConnection so they don't require the connection to be opened first.
  • Fixed userdef aggregate functions so they play nice with each other when appearing multiple times in the same statement.
  • Fixed the editing and saving of default values in the table designer.
  • Fixed ForeignKeys schema to support multi-column foreign keys. Also hacked support for them in the table designer, provided two foreign keys in the designer have the same name and reference the same foreign table and different columns. Will implement first-class support for this in the next release.

1.0.56.0 - August 11, 2008

  • Fixed a bug in the table designer when designing new tables, wherein you had to save the table first before being able to create indexes and foreign keys.
  • Tweaks to decimal type handling. The 'decimal' type can't be represented by Int64 or Double (without loss of precision) in SQLite, so we have to fudge it by treating it like a string and converting it back and forth in the provider. Unfortunately backing it to the db as a string causes sorting problems. See this post for details on using a custom collation sequence to overcome the sorting issue arising from this patch.
  • Minor tweaks and bugfixes to the test program and the provider.
  • More adjustments to make the managed-only version of the provider run and pass all tests on Mono.
  • LINQ to Entities bits heavily updated and compiled against VS2008 SP1 RTM. SQLite LINQ support is still considered beta.

1.0.55.0 - August 6, 2008

  • Code merge with SQLite 3.6.1
  • Added support for the user-contributed extension-functions at http://www.sqlite.org/contrib. Feel free to override any of them with your own implementation. The new functions are: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi, replicate, charindex, leftstr, rightstr, reverse, proper, padl, padr, padc, strfilter, and aggregates stdev, variance, mode, median, lower_quartile, upper_quartile.
  • Moved the last_rows_affected() function to the C extension library.
  • Added a new class, SQLiteFunctionEx which extends SQLiteFunction and adds the ability for a user-defined function to get the collating sequence during the Invoke/Step methods. User-defined functions can use the collating sequence as a helper to compare values.
  • When registering user-defined collation sequences and functions, the provider will now register both a UTF8 and a UTF16 version instead of just UTF8.
  • Revamped connection pooling and added static ClearPool() and ClearAllPools() functions to SQLiteConnection. Behavior of the pool and its clearing mechanics match SqlClient.
  • Fixed connections going to the pool so that any unfinalized lingering commands from un-collected datareaders are automatically reset and any lurking transactions made on the connection are rolled back.
  • Transaction isolation levels are now partially supported. Serializable is the default, which obtains read/write locks immediately -- this is compatible with previous releases of the provider. Unspecified will default to whatever the default isolation mode is set to, and ReadCommitted will cause a deferred lock to be obtained. No other values are legal.
  • Revamped the test.exe program. It's now an interactive GUI application. Easier for me to add tests now.
  • Tweaks to the VS designer package and installer.
  • More adjustments to the internal SQLite3.Prepare() method to account for both kinds of lock errors when retrying.
  • Stripped a lot of unnecessary interop() calls and replaced with base sqlite calls. Revamped most of UnsafeNativeMethods to make it easier to port the code.
  • Rerigged internal callbacks for userdef functions and other native to managed callbacks. More portable this way.
  • Source can now can be compiled with the SQLITE_STANDARD preprocessor symbol to force the wrapper to use the stock sqlite3 library. Some functionality is missing, but its minimal. None of the precompiled binaries are compiled using this setting, but its useful for testing portability.
  • Added "boolean" and a couple other missing datatypes to the "DataTypes" schema xml file. Used by the VS designer when displaying tables and querying.
  • Added a new connection string option "Read Only". When set to True, the database will be opened in read-only mode.
  • Added a new connection string option "Max Pool Size" to set the maximum size of the connection pool for a given db file connection.
  • Added a new connection string option "Default IsolationLevel" to set the default isolation level of transactions. Possible values are Serializable and ReadCommitted.
  • Added a new connection string option "URI" as an optional parameter for compatibility with other ports of the provider.

1.0.54.0 - July 25, 2008

  • Fixed the setup project, which somehow "forgot" to include all the binaries in the 53 release.
  • Fixed a crash in the table designer when creating a new table and tabbing past the "Allow Nulls" cell in the grid while creating a new column.
  • Fixed a mostly-benign bug in SQLiteDataReader's GetEnumerator, which failed to pass along a flag to the underyling DbEnumerator it creates. This one's been around since day 1 and nobody's noticed it in all these years.
  • Added a new connection string parameter "Journal Mode" that allows you to set the SQLite journal mode to Delete, Persist or Off.

1.0.53.0 - July 24, 2008

  • Enabled sqlite_load_extension
  • Added retry/timeout code to SQLite3.Prepare() when preparing statements for execution and a SQLITE_BUSY error occurs.
  • Added a new schema to SQLiteConnection.GetSchema() called Triggers. Used to retrieve the trigger(s) associated with a database and/or table/view.
  • Extensive updates to table/view editing capabilities inside Visual Studio's Server Explorer. The program now parses and lets you edit CHECK constraints and triggers on a table, as well as define triggers on views. Experimental still, so e-mail me if you have issues.
  • Minor bugfix to the ViewColumns schema to return the proper base column name for a view that aliases a column.
  • Fixed the insert/update/delete DML support in the Linq module.
  • Changed the behavior of SQLiteCommand to allow a transaction to be set even if the command hasn't been associated with a connection yet.

1.0.52.0 - July 16, 2008

  • Code merge with SQLite 3.6.0
  • Added a lot of previously-missing exports to the DEF file for the native library.
  • Fixed SQLiteDataReader to check for an invalid connection before operating on an open cursor.
  • Implemented the Cancel() function of SQLiteCommand to cancel an active reader.
  • Added beta table and view designers to the Visual Studio Server Explorer. You can now edit/create tables and views, manage indexes and foreign keys from Visual Studio. This feature is still undergoing testing so use at your own risk!
  • Fixed the Server Explorer so VS2005 users can once again right-click tables and views and open the table data.
  • Added some new interop code to assist in returning more metadata not normally available through the SQLite API. Specifically, index column sort modes and collating sequences. Also added code to detect (but not parse) CHECK constraints, so the table designer can pop up a warning when editing a table with these constraints. Since I can't currently parse them.
  • Lots of LINQ SQL generation improvements and fixes.
  • Made some progress cleaning up and fixing up the schema definitions and manifests for EdmGen.
  • Added a built-in SQLiteFunction called last_rows_affected() which can be called from SQL to get the number of rows affected by the last update/insert operation on the connection. This is roughly equivalent to Sql Server's @@ROWCOUNT variable.

1.0.51.0 - July 1, 2008

  • VS2008 SP1 Beta1 LINQ Support
  • Added experimental Entity Framework support in a new library, System.Data.SQLite.Linq. Some things work, some don't. I haven't finished rigging everything up yet. The core library remains stable. All LINQ-specific code is completely separate from the core.
  • Added some columns to several existing schemas to support some of the EDM framework stuff.
  • Minor tweaks to the factory to better support dynamic loading of the Linq extension library for SQLite.
  • SQLite's busy handler was interfering with the provider's busy handling mechanism, so its been disabled.

1.0.50.0 - June 27, 2008

  • Fixed some lingering dispose issues and race conditions when some objects were finalized.
  • Fixed the SQLiteConvert.Split() routine to be a little smarter when splitting strings, which solves the quoted data source filename problem.
  • Enhanced the mergebin utility to work around the strong name validation bug on the Compact Framework. The old workaround kludged the DLL and caused WM6.1 to fail to load it. This new solution is permanent and no longer kludges the DLL.

1.0.49.0 - May 28, 2008

  • Code merge with SQLite 3.5.9
  • Fixed schema problems when querying the TEMP catalog.
  • Changed BLOB datatype schema to return IsLong = False instead of True. This was preventing DbCommandBuilder from using GUID's and BLOB's as primary keys.
  • Fix rollover issue with SQLite3.Reset() using TickCount.
  • Fixed SQLiteDataReader to dispose of its command (if called for) before closing the connection (when flagged to do so) instead of the other way around.
  • Fixed a DbNull error when retrieving items not backed by a table schema.
  • Fixed foreign key constraint parsing bug.
  • Added FailIfMissing property to the SQLiteConnectionStringBuilder.
  • Converted the source projects to Visual Studio 2008.

1.0.48.0 - December 28, 2007

  • Code merge with SQLite 3.5.4
  • Calling SQLiteDataReader.GetFieldType() on a column with no schema information and whos first row is initially NULL now returns type Object instead of type DbNull.
  • Added support for a new DateTime type, JulianDay. SQLite uses Julian dates internally.
  • Added a new connection string parameter "Default Timeout" and a corresponding method on the SQLiteConnection object to change the default command timeout. This is especially useful for changing the timeout on transactions, which use SQLiteCommand objects internally and have no ADO.NET-friendly way to adjust the command timeout on those commands.
  • FTS1 and FTS2 modules were removed from the codebase. Please upgrade all full-text indexes to use the FTS3 module.

1.0.47.2 - December 10, 2007

  • Fixed yet one more bug when closing a database with unfinalized command objects
  • Fixed the DataReader's GetFieldType function when dealing with untyped SQLite affinities

1.0.47.1 - December 5, 2007

  • Fixed a leftover bug from the codemerge with SQLite 3.5.3 that failed to close a database.
  • Fixed the broken Compact Framework distribution binary.
  • SQLite 3.5.x changed some internal infrastructure pieces in the encryption interface which I didn't catch initially. Fixed.

1.0.47.0 - December 4, 2007

  • Code merge with SQLite 3.5.3
  • Added installer support for Visual Studio 2008. Code is still using the VS2005 SDK so one or two bells and whistles are missing, but nothing significant.
  • This is the last version that the FTS1 and FTS2 extensions will appear. Everyone should rebuild their fulltext indexes using the new FTS3 module. FTS1 and FTS2 suffer from a design flaw that could cause database corruption with certain vacuum operations.
  • Fixed pooled connections so they rollback any outstanding transactions before going to the pool.
  • Fixed the unintended breaking of the TYPES keyword, and mis-typing of untyped or indeterminate column types.
  • Assert a FileIOPermission() requirement in the static SQLiteFunction constructor.
  • The CE-only SQLiteFunction.RegisterFunction() is now available on the desktop platform for dynamic registration of functions. You must still close and re-open a connection in order for the new function to be seen by a connection.
  • Fixed the "database is locked" errors by implementing behavioral changes in the interop.c file for SQLite. Closing a database force-finalizes any prepared statements on the database to ensure the connection is fully closed. This was rather tricky because the GC thread could still be finalizing statements itself.
  • Modifed the mergebin utility to help circumvent a long-standing strong name verification bug in the Compact Framework.

1.0.46.0 - September 30, 2007

  • Fixed faulty logic in type discovery code when using SQLiteDataReader.GetValue().
  • Fixed Connection.Open() bug when dealing with :memory: databases.
  • Fixed SQLiteCommand.ExecuteScalar() to return a properly-typed value.
  • Added support for SQLiteParameter.ResetDbType().
  • Added test cases for rigid and flexible type testing.

1.0.45.0 - September 25, 2007

  • Breaking change in GetSchema("Indexes") -- MetaDataCollections restrictions and identifier parts counts were wrong for this schema and I was using the wrong final parameter as the final restriction. Meaning, if you use the Indexes schema and are querying for a specific index the array should now be {catalog, null, table, index } instead of {catalog, null, table, null, index}
  • Fixed some errors in the encryption module, most notably when a non-default page size is specified in the connection string.
  • Fixed SQLiteDataReader to better handle type-less usage scenarios, which also fixes problems with null values and datetimes.
  • Fixed the leftover temp files problem on WinCE
  • Added connection pooling. The default is disabled for now, but may change in the future. Set "Pooling=True" in the connection string to enable it.
  • Sped up SQLiteConnection.Open() considerably.
  • Added some more robust cleanup code regarding SQLiteFunctions.
  • Minor additions to the code to allow for future LINQ integration into the main codebase.
  • Fixed a long-standing bug in the Open() command of SQLiteConnection which failed to honor the documented default behavior of the SQLite.NET provider to open the database in "Synchronous=Normal" mode. The default was "Full".
  • If Open() fails, it no longer sets the connection state to Broken. It instead reverts back to Closed, and cleans up after itself.
  • Added several new parameters to the ConnectionString for setting max page count, legacy file format, and another called FailIfMissing to raise an error rather than create the database file automatically if it does not already exist.
  • Fixed some designer toolbox references to the wrong version of the SQLite.Designer
  • Fixed a bug in the mergebin utility with regards to COR20 metadata rowsize computations.
  • Minor documentation corrections

1.0.44.0 - July 21, 2007

  • Code merge with SQLite 3.4.1
  • Fixed a bug in SQLiteConnection.Open() which threw the wrong kind of error in the wrong kind of way when a database file could not be opened or created.
  • Small enhancements to the TYPES keyword, and added documentation for it in the help file.
  • Hopefully fixed the occasional SQLITE_BUSY errors that cropped up when starting a transaction. Usually occurred in high-contention scenarios, and the underlying SQLite engine bypasses the busy handler in this scenario to return immediately.

1.0.43.0 - June 21, 2007

  • Code merge with SQLite 3.4.0
  • Fixed a reuse bug in the SQLiteDataAdapter in conjunction with the SQLiteCommandBuilder. It's been there unnoticed for more than a year, so it looks like most folks never encountered it.
  • Fixed an event handler bug in SQLiteCommandBuilder in which it could fail to unlatch from the DataAdapter when reused. Relates to the previous bugfix.
  • Fixed a double-dispose bug in SQLiteStatement that triggered a SQLiteException.

1.0.42.0 - June 1, 2007

  • Code merge with SQLite 3.3.17
  • Changed the SQLiteFunction static constructor so it only enumerates loaded modules that have referenced the SQLite assembly, which hopefully should cut down dramatically the time it takes for that function to execute.
  • Added the FTS2 full-text search extension to the project. Look for FTS1 to disappear within the next couple of revisions.
  • Fixed a bug introduced with the finalizers that triggered an error when statements ended with a semi-colon or had other non-parsable comments at the end of a statement
  • Fixed an intermittent multi-threaded race condition between the garbage collector thread and the main application thread which lead to an occasional SQLITE_MISUSE error.
  • Fixed another issue relating to SQLite's inherent typelessness when dealing with aggregate functions which could return Int64 or Double or even String for a given row depending on what was aggregated.
  • Remembered to recompile the DDEX portion of the engine this time, so Compact Framework users can once again use the design-time functionality

1.0.41.0 - April 23, 2007

  • Code merge with SQLite 3.3.16
  • Second go at implementing proper finalizers to cleanup after folks who've forgotten to Dispose() of the SQLite objects
  • Enhanced GetSchema(IndexColumns) to provide numeric scale and precision values
  • Fixed the column ordinals in GetSchema(IndexColumns) to report the ordinal of the column in the index, not the table
  • Fixed a bug whereby parameters named with an empty string (such as String.Empty) were treated like a named parameter instead of an unnamed parameter

1.0.40.0 - January 31, 2007

  • Code merge with SQLite 3.3.12
  • Lots of new code to handle misuse of the library. Implemented finalizers where it made sense, fixed numerous garbage collector issues when objects are not disposed properly, fixed some object lifetime issues, etc.
  • A failed Commit() on a transaction no longer leaves the transaction in an unusable state.

1.0.39.1 - January 11, 2007

  • Fixed a really dumb mistake that for some reason didn't trigger any errors in the testcases, whereby commands when associated with a connection were not adding or removing themselves from an internal list of commands for that connection -- causing a "database is locked" error when trying to close the connection.

1.0.39.0 - January 10, 2007

  • Code merge with SQLite 3.3.10
  • Fixed a multi-threaded race condition bug in the garbage collector when commands and/or connections are not properly disposed by the user.
  • Switched the encryption's internal deallocation code to use sqlite's built-in aux functions instead of modifying the pager.c source to free the crypt block. This eliminates the last of the code changes the provider makes to the original sqlite engine sources. Props to Ralf Junker for pointing that out.

1.0.38.0 - November 22, 2006

  • Fixed a bug when using CommandBehavior.KeyInfo whereby integer primary key columns may be duplicated in the results.
  • Enhanced the CommandBuilder so that update/delete statements are optimized when the affected table contains unique constraints and a primary key is present.
  • Fixed a bug in the DataReader when used in conjunction with CommandBehavior.CloseConnection.

1.0.37.0 - November 19, 2006

  • Added support for CommandBehavior.KeyInfo. When specified in a query, additional column(s) will be returned describing the key(s) defined for the table(s) selected in the query. This is optimized when INTEGER PRIMARY KEY is set for the given tables, but does additional work for other kinds of primary keys.
  • Removed the default values from SQLiteDataReader.GetTableSchema(), to better follow Sql Server's pattern and suppress schema errors when loading the records into a dataset/datatable.
  • Allow integers to implicitly convert to double/decimal/single.

1.0.36.1 - October 25, 2006

  • Added support for LONGVARCHAR, SMALLDATE and SMALLDATETIME. These were actually added in 1.0.36.0 but were undocumented.
  • Fixed the embedded helpfile which was accidentally built from old sources.
  • Fixed an unfortunate re-entry of a bug in the .36 codebase that caused the provider to "forget" about commands on a connection under certain circumstances.

1.0.36.0 - October 23, 2006

  • Code merge with SQLite 3.3.8, including support for full-text search via the FTS1 extension.
  • Fixed a bug retrieving data types when UseUtf16Encoding is true. Side-effect of further merging the common code between the two base classes.
  • Fixed a bug with System.Transactions whereby a connection closed/disposed within a transaction scope is rolled back and cannot be committed.
  • Added more error checking and reporting to transactions to help user's isolate the source of transaction failures.
  • Implemented a workaround for a Compact Framework issue regarding strong-named assemblies containing a PE section with a raw size less than the virtual size.

1.0.35.1 - September 12, 2006

  • Fixed the TYPES keyword to work when UseUTF16Encoding is true.
  • Fix another bug revealed in 1.0.35.0 regarding infinite loops when the 2nd or subsequent statements of a semi-colon separated command cannot be parsed.
  • Updated the help documentation.

1.0.35.0 - September 10, 2006

  • Fixed an infinite loop bug in SQLiteCommand caused when multiple semi-colon separated statements in a single command are executed via datareader and one of the statements contains a syntax error preventing it from being prepared.
  • Added the TYPES preparser keyword to be placed before a SELECT statement to aid the wrapper in converting expressions in a subsequent select clause into more robust types. Documentation yet to be integrated, but available on the forums.
  • Added a new connectionstring parameter "BinaryGUID=true/false" (default is "true"). When true, guid types are stored in the database as binary blobs to save space. Binary has been the default format since 1.0.32.0 but this parameter eases backward compatibility.

1.0.34.0 - September 4, 2006

  • Fixed a bug in SQLiteParameterCollection.RemoveAt(namedparam)
  • Fixed a bug in SQLiteDataReader introduced in 1.0.30 that broke DateTimes using the Ticks option in the connection string.
  • Fixed a bug in the recent changes to guid behavior wherein using a datareader's indexer to fetch a guid from a column containing both binary and text guids would sometimes return a byte array instead of a guid.
  • Enacted a workaround involving typed datasets in Compact Framework projects in which it took an excessive amount of time to open a form and generated a lot of temporary files in the user's Local Settings\Application Data\Microsoft\VisualStudio\8.0\Assembly References folder.

1.0.33.0 - August 21, 2006

  • Code merge with SQLite 3.3.7
  • Fixed a bug in SQLiteConnection that caused it to "forget" about commands bound to it and occasionally throw an error when a database is closed and opened repeatedly.

1.0.32.0 - August 6, 2006

  • Added AllowPartiallyTrustedCallers attribute to the assembly
  • Added the missing "nchar" type
  • Added support for binary Guid's. Guids are now stored as binary by default when using parameterized queries. Text guids are still fully supported.
  • Fixed a TransactionScope() error that caused the transaction not to be completed.
  • Enhanced parameter names so that if they are added to the Parameters collection without their prefix character (@ : or $) they are still properly mapped.

1.0.31.0 - July 16, 2006

  • Re-applied the view parsing bugfix in 1.0.29.0 that was accidentally reverted out of the 30 build.
  • Fixed SQLiteCommand.ExecuteScalar() to return null instead of DbNull.Value when no rows were returned.
  • Design-time installer now installs the package-based designer on full Visual Studio versions. Express editions continue to use the packageless designer.
  • In Visual Studio (not Express), you can now right-click a SQLite connection in the Server Explorer and vacuum the database and change the encryption password.

1.0.30.1 - July 2, 2006

  • Code merge with SQLite 3.3.6
  • Added support for the |DataDirectory| keyword in the Data Source filename string.
  • Added hook notification support to SQLiteConnection. Specifically, there are three new events on the SQLiteConnection object which are raised when an update/insert/delete occurs and when transactions are committed and rolled back.
  • Changed SQLiteTransaction to default to BEGIN IMMEDIATE instead of just BEGIN, which solves a multithreaded race condition.
  • Changed SQLiteDataReader to better support SQLite's typelessness. The data reader no longer caches column affinity, but re-evaluates it for each column/row.
  • Fixed a bug in Prepare() which caused an intermittant fault due to the code accessing the memory of an unpinned variable.
  • Fixed a multithreaded lock-retry bug in in SQLiteConnection.Open() and in SQLiteTransaction, which failed to use a command timeout before giving up.

1.0.29.0 - May 16, 2006

  • Fixed a bug in the Views schema information which caused multi-line view definition statements not to be parsed
  • Fixed a parsing bug in SQLiteDataReader.GetSchemaTable() to account for numeric(x,y) datatypes with specified precision and scale
  • Fixed a bug in SQLiteConnection.Open() which tried to automatically enlist in an ambient transaction but had not yet set the state of the database to Opened, thereby causing a transaction fault
  • Changed SQLiteException to inherit from DbException on the full framework

1.0.28.0 - April 14, 2006

  • Code merge with SQLite 3.3.5
  • You can now specify a relative path in the Compact Framework's "Data Source" by prefixing the file with ".\". i.e. "Data Source=.\\mydb.db3"
  • Several more changes and enhancements to schemas for better compatibility.
  • Fixed several bugs with the 64-bit builds of the provider. The x64 binary is now optimized.
  • Design-time installer now tries to install the 64-bit builds into the GAC along with the 32-bit build.
  • Fixed a bug in the SQLiteDataReader.GetSchemaTable() function when used with tables containing apostrophes.
  • Fixed an XSD-related bug whereby the XSD utility was unable to locate the provider and could not generate typed datasets.
  • Added NTEXT and STRING datatypes to the list of recognized keywords (used for schema retrieval).
  • Due to the XSD bug and other potential problems related to external build utilities, changes to the installation of the designer have had to be made. The installer used to write the DbProviderFactories XML into the devenv.exe.config file and its express cousins, but now has to write instead to the machine.config.
  • Installer writes to both the 32-bit machine.config and the 64-bit machine.config if it exists.

1.0.27.1 - February 28, 2006

  • Fixed a bug when doing data binding in Compact Framework projects that prevented you from assigning a typed dataset to a bindingsource. It turns out, the CF version of the SQLite provider needs to be flagged as retargetable so it'll work in the design-time desktop environment. No changes were made to the desktop build, but the revision was bumped on all libraries anyway in order to keep them sync'd.

1.0.27.0 - February 27, 2006

  • Many optimizations and a few more minor adjustments to schemas and schema retrieval performance.
  • Lots of design-time attributes added to the code. The DbDataAdapter, DbCommand, and DbConnection objects now have greatly enhanced design-time capabilities when added to the toolbox and dropped on a form.
  • Lots of Server Explorer enhancements.
  • Binaries are now distributed in a setup program for easier administration and configuration of the provider.

1.0.26.2 - February 15, 2006

  • Yet another bugfix to index schemas, which was incorrectly marking most indexes as primary key indexes.
  • Fixed GetSchema() to accept a null string array.
  • Fixed a misspelled export in the core C library that prevented databases opened with UTF16Encoding from getting schema information and would likely cause an error if attempted.

1.0.26.1 - February 14, 2006

  • Fixed even more minor schema bugs having to do with indexes.
  • Added two missing pieces in the SQLite designer which were preventing it from being used from within VS Express editions.
  • Several bugfixes to the design-time installer program, including supporting 64-bit environments.

1.0.26.0 - February 11, 2006

  • Code merge with SQLite 3.3.4
  • Fixed an encryption bug when changing the password of databases over 1gb in size.
  • Fixed various designer issues related to construction of named parameters.
  • Retooled the GetSchema() method of SQLiteDataReader to use the new 3.3.4 API functions, and made several enhancements and fixes to schemas.
  • Implemented the SourceColumnNullMapping property of SQLiteParameter to fix a DbCommandBuilder code generation bug.
  • Removed the runtime dependency on MSVCR80.DLL. File size is somewhat larger for the varying desktop versions, but the Compact Framework version remains the same.
  • Created an install program to manage installation and uninstallation of the SQLite design-time support.
  • Designer support now works for all Visual Studio editions, including all Express Editions.
  • Design-time installer will now remove (if present) the machine.config SQLite entries in favor of installing the xml code into the devenv.exe.config file (or any of the variations for express editions). The officially-accepted behavior of using DbProviderFactories is to add the code to your app.config file, and the machine.config file should not be touched.

1.0.25.0 - January 31, 2006

  • Code merge with SQLite 3.3.3
  • Added automatic distributed transaction enlistment and implemented the DbConnection.EnlistTransaction method for manual enlistment.
  • Nested transactions are now supported.
  • Rearranged the timing of SetPassword(), which now must be called before the database is opened instead of afterwards. Optionally, the password can be supplied in the ConnectionString.
  • Fixed a bug in SQLiteFunction that caused a failure when an empty resultset was returned and a custom user aggregate function was used in the query.
  • The designer has had another round of cleanup applied, in preparation for moving to a VS package.
  • Added SQLiteMetaDataCollectionNames class.

1.0.24.6 beta - January 23, 2006

  • This beta is built from sqlite.org's 3.3.2 beta.
  • Eliminated the static linking of mscoree from all binaries. Native projects can now use the library without any dependencies on the .NET framework, while managed projects continue to be able to use the library normally.

1.0.24.5 beta - January 20, 2006

  • This beta is built from sqlite.org's 3.3.1 alpha and contains development-in-progress code. Therefore no guarantees can be made regarding its suitability for production use.
  • You no longer need to distribute 2 files on the CompactFramework. You can delete SQLite.Interop.DLL entirely. I wrote a custom tool called "mergebin" (available in the source zip file) which combines the two libraries and gets around a glaring defect in the VS2005 linker for ARM processors which doesn't allow you to link netmodules.
  • x64 and ia64 builds now use the same strong name as the x86 build. This means breaking backward compatibility, but it was necessary in order to allow you to drop any of those 3 builds onto a PC and have your .NET program run properly. Prior to this, you'd get an error if you built your program using the x86 build, and then installed the x64 version on a target machine and tried to run your program against it.
  • The entire source project has been gone over top to bottom. A debug build no longer combines the binaries into a single module, which was preventing proper debugging.

1.0.24.4 beta - January 16, 2006

  • This beta is built from sqlite.org's 3.3.1 alpha and contains development-in-progress code. Therefore no guarantees can be made regarding its suitability for production use.
  • Fixed a bug in the UTF-16 handling code for preparing statements due to a behavioral change in SQLite 3.3.0.
  • Added pager.c code necessary to cleanup after an encrypted file is closed.
  • Fixed an encryption bug that caused a fault when an encrypted file was rolled back.
  • Modified the testcase code to take advantage of optimizations regarding the use of a DbCommandBuilder. DataAdapter insert speed increased dramatically as a result.

1.0.24.3 beta - January 10, 2006

  • This beta is built from sqlite.org's CVS HEAD (as it appeared at of the date of this beta) and contains development-in-progress code. Therefore no guarantees can be made regarding its suitability for production use.
  • Added support for database encryption at the pager level. Databases are encrypted using a 128-bit RC4 stream algorithm. To open an existing encrypted database, you may now specify a "Password={password}" text in the ConnectionString, or you may call the SQLiteConnection.SetPassword() function to set the password on an open connection. To encrypt existing non-encrypted databases or to change the password on an encrypted database, you must use the SQLiteConnection.ChangePassword() function. If you use SetPassword() instead of specifying a password in the connection string, or call ChangePassword() you may use a binary byte array or a text string as the password.
  • Rewrote the locking implementation for the Compact Framework. It is now more robust and incorporates into the SQLite codebase more efficiently than the previous CE adaptation.
  • Moved some of the embedded schema XML data into a resource file to ease code readability.
  • Automated the fixup of the original sqlite codebase's source prior to compiling, to ease merging with sqlite.org's source.

1.0.24.2 - December 30, 2005

  • Fixed the SQLiteDataReader.HasRows property to return the proper value.
  • Implemented the inadvertently neglected RecordsAffected property on SQLiteDataReader.
  • SQLiteFunction static constructor was changed to pre-filter classes with only the SQLiteFunctionAttribute. The code was throwing an exception when certain assemblies were referenced in a project.
  • Fixed the SQLiteDataAdapter OnRowUpdated event, which was using the wrong variable to find the attached event handler and subsequently not raising the event.
  • Small optimizations and fixes to SQLiteDataReader.NextResult().

1.0.24.1 - December 19, 2005

  • Update core SQLite engine to 3.2.8

1.0.24 - December 9, 2005

  • Fixed the Catalogs schema bug that caused attached databases not to be re-attached to a cloned connection
  • Enhanced transactions to allow for a deferred or immediate writelock. SQLiteConnection.BeginTransaction() now has an additional overload to support it
  • Commands are now prepared as they are executed instead of beforehand. This fixes a bug whereby a multi-statement command that alters the database and subsequently references the altered data would fail during Prepare().
  • Tightened up the SQLiteDataReader to prevent reading columns before calling the first Read() and to prevent reading columns after the last Read().
  • A more descriptive error is thrown if there aren't enough parameters in the command to satisfy the parameters required by the statement(s).

1.0.23 - November 21, 2005

  • Named parameters may now begin with @ to ease portability of the provider. SQLite's named parameters are ordinarily prefixed with a : or $. The designer will still use the $ prefix however, since its more compatible with the default SQLite engine.
  • Added several alternate ISO8601 date/time formats to SQLiteConvert.cs to increase compatibility.
  • Relaxed coersion restrictions to work better with SQLite's inherent typelessenss.

1.0.22 - November 11, 2005

  • Fixed some globalization issues which resulted in incorrect case-insensitive comparisons
  • Fixed a bug in the routine that finds all user-defined functions in a loaded assembly. It would throw an exception if any of the types in the assembly could not be loaded. The exception is now caught and handled appropriately.

1.0.21 - November 4, 2005

  • Fixed a designer bug when creating typed datasets with parameterized queries.
  • The above fix then exposed another bug in the datareader's ability to query schema information on parameterized commands, which was also fixed.
  • Compiled against the RTM version of VS2005.
  • Rewrote the design-time install script to use the XML DOM objects when writing to the machine.config and to automatically register the DLL in the GAC.
  • Made changes to the app.config descriptions and help file to improve version-independent factory support.

1.0.20 - October 19, 2005

  • Fixed a shortcut in SQLiteBase.GetValue which was insufficient for international environments. The shortcut was removed and the "proper" procedure put in.

1.0.19 - October 5, 2005

  • Code merge with SQLite 3.2.7
  • Fixed bugs in the CE port code (os_wince.c) which were brought to light by recent changes in the SQLite engine.
  • Recompiled and modified to be compatible with the September VS2005 Release Candidate.
    Beta 2 users should continue to use 1.0.18.1

1.0.18.1 - September 19, 2005

  • Code merge with SQLite 3.2.6

1.0.18 - September 1, 2005

  • Added type-specific method calls when using the various SQLite classes that would've normally returned a a generic Db base class, which aligns the code better with the Microsoft-supplied data providers.

1.0.17 - August 26, 2005

  • Code merge with SQLite 3.2.5
  • Added Itanium and x64 build settings to the project (needs testing)
  • Bugfixes and enhancements to several schema types
  • Additional design-time support to include index and foreign key enumerations. Requires re-registering the designer using INSTALL.CMD. The new designer code now allows the VS query designer and typed datasets to automatically link up foreign keys, use indexes, and automatically generate relationships from the schema.
  • Additional static methods on SQLiteConnection to create a database file, encrypt a file using the Encrypted File System (EFS) on NTFS (requires NT 2K or above) and NTFS file compression

1.0.16 - August 24, 2005

  • Code merge with SQLite 3.2.4 with the large delete bugfix in CVS (which will become 3.2.5 soon)
  • Added new GetSchema() types: IndexColumns, ViewColumns, ForeignKeys

1.0.15 - August 22, 2005

  • Code merge with SQLite 3.2.3
  • Minor updates for better design-time experience. More design-time code to follow in subsequent releases.

1.0.14 - August 16, 2005

  • Fixed a bug in the SQLiteDataAdapter due to insufficient implementation of the class. The RowUpdating and RowUpdated events are now properly implemented, but unfortunately inserting and updating data in a DataTable or DataSet is now much slower. This is the proper design however, so the changes are here to stay.
  • Lots of schema changes to support Visual Studio's Data Designer architecture.
  • Added Designer support for the provider. It's not 100%, but you can design queries, add typed datasets and perform quite a number of tasks all within Visual Studio now.

1.0.13 - August 8, 2005

  • Fixed a named parameter bug in the base SQLite_UTF16 class, which of course only showed up when a database connection was opened using the UseUTF16Encoding=True parameter.
  • Fixed a performance issue in SQLite_UTF16 involving string marshaling.

1.0.12 - August 5, 2005

  • Full support for the Compact Framework. Each build (Debug/Release) now has a platform, either Win32 or Compact Framework. The correct projects are built accordingly. See the Distributing SQLite section for information on what files need to be distributed for each platform.
  • Modified SQLite3.Reset() and Step() functions to transparently handle timeouts while waiting on the database to become available (typically when a writer is waiting on a reader to finish, or a reader is waiting on a writer to finish).
  • Lots of code cleanup as suggested by the Code Analyzer (FxCop).
  • Lots of updates to the helpfile (as you can see).
  • Statements were already prepared lazily in a SQLiteCommand, but now its even more lazy. Statements are now only prepared if the statements haven't been previously prepared and a Prepare() function is called (and the command is associated with a connection) or just prior to the command being executed.

1.0.11 - August 1, 2005

  • For everything except the Compact Framework, System.Data.SQLite.DLL is now the only DLL required to use this provider! The assembly is now a multi-module assembly, containing both the native SQLite3 codebase and the C# classes built on top of it. The Compact Framework version (when completed) will not be able to support this feature, so backwards compatibility with the Compact Framework has been preserved for the future.
  • Fixed a bug in SQLiteCommand.ExecuteScalar() that caused it to stop executing commands once it obtained the first column of the first row-returning resultset. Any remaining statements after the row-returning statement was ignored.

1.0.10 - June 10, 2005

  • Fixed a bug in the SQLite3.cs Prepare() function that created a statement even when the SQLite engine returned a NULL pointer. Typically this occurs when multiple statements are processed and there are trailing comments at the end of the statement.
  • Fixed a bug in SQLiteStatement.cs that retrieved parameter names for a parameterized query. SQLite's parameters are 1-based, and the function was starting at 0. This was fine when all parameters were unnamed, but for named parameters it caused the parameters to be out of whack.

1.0.09a - May 25, 2005

  • Fixed a broken helpfile and corrected some obsolete help remarks in SQLiteFunction.cs
  • Added a version resource to the SQLite.Interop.DLL.

1.0.09 - May 24, 2005

  • Code merge with the latest 3.21 version of SQLite.
  • Removed obsolete methods and properties for Whidbey Beta 2

1.0.08 Refresh - Mar 24, 2005

  • Code merge with the latest 3.20 version of SQLite.
  • Recompiled the help file to fix a build error in it.

1.0.08 - Mar 11, 2005

  • Added additional #if statements to support the old beta 1 edition of VS2005.
  • Code merged the SQLite 3.14 source.

1.0.07 - Mar 5, 2005

  • Made more optimizations to frequently-called functions, resulting in significant performance gains in all tests.
  • Recompiled the binaries using the latest VS2005 February CTP, resulting in yet more significant speed gains. The 100k insert test used to take 3.5 seconds and the insertwithidentity took almost 8 seconds. With the above two changes, those tests are now executing in 1.9 and 4.9 seconds respectively.

1.0.06 - Mar 1, 2005

  • Speed-ups to SQLiteDataReader. It was interop'ing unnecessarily every time it tried to fetch a field due to a logic error.
  • Changed/Added some code to SQLiteConvert's internal DbType, Type and TypeAffinity functions.
  • Fixed the SQLiteDataReader to obey the flags set in the optional CommandBehavior flag from SQLiteCommand.ExecuteReader().
  • Changed the default page size to 1024 to reflect the defaults of SQLite. Ignores the "Page Size" connection string option for memory databases, as tests revealed that changing it resulted in memory corruption errors.
  • Performance enhancements to the SQLiteCommand and SQLiteStatement classes which reduced the 100,000 row insert execution time as well as the various Function execution times significantly.

1.0.05 - Feb 25, 2005

  • Fixed the SQLite3 C# class step/reset functions to accomodate schema changes that invalidate a prepared statement. Statements are recompiled transparently.
  • Moved all native DLL declarations to an UnsafeNativeMethods class.
  • Split several classes into their own modules for readability.
  • Renamed many internal variables, reviewed access to variables marked as internal and altered their protection levels accordingly.
  • Due to the presence of the altered sqlite3 codebase and so many added interop functions, I decided to rename the sqlite3 C project and the DLL to SQLite.Interop.DLL. This is the same core sqlite3 codebase but designed specifically for this ADO.NET provider. This eliminates any possibility of someone dropping another build of sqlite3.dll into the system and rendering the provider inoperable. In the future if the folks at sqlite.org finally introduce a method of retrieving column usage for an arbitrary prepared statement, I'll retool this library to be a lightweight function call wrapper around the core binary distribution.
  • Added [SuppressUnmanagedCodeSecurity] attribute to the UnsafeNativeMethods class which brings VS2005 November CTP execution speeds inline with the December CTP.
  • Added a bin directory to the project root where pre-compiled binaries can be found.
  • Added a doc directory where preliminary documentation on the class library can be found.
  • Documented a lot more of the classes internally.

1.0.04 - Feb 24, 2005

  • Removed the SQLiteContext class and revamped the way UserFunctions work to simplify the imlementation.
  • Fixed a counting bug in the TestCases class, specifically in the function tests where I wasn't resetting the counter and it was consequently reporting intrinsic and raw select calls as being much much faster than they actually were. The numbers are now much closer to what I expected for performance, with .NET user-functions still being the slowest, but only by a small margin.
  • Small performance tweaks to SQLiteDataReader.
  • Added PageSize to the SQLiteConnectionStringBuilder and subsequently to the SQLiteConnection
  • Added a PRAGMA encoding=XXX execution statement to the SQLiteConnection after opening a connection.

1.0.03 - Feb 23, 2005

  • Fixed up SQLiteCommandBuilder to correct implementation errors, which resulted in an enormous performance boost in the InsertMany test. 10,000 row insert that executed in 1500ms now executes in 500ms.
  • Fixed several errors in the SQLite3_UTF16 class. ToString() was working incorrectly and the Open() method failed to register user defined functions and collations.
  • Fixed a bug in SQLiteCommand.ClearCommands() whereby only the first statement was being properly cleaned up.
  • Fixed a bug in SQLiteDataReader whereby calling NextResult() would not properly reset the previously-executed command in the sequence.
  • Added an InsertManyWithIdentityFetch test, which appends a select clause to populate the ID of the last inserted row into the InsertCommand, demonstrating ADO.NET's ability to auto-fetch identity columns on insert.

1.0.02 - Feb 21, 2005

  • Tweaks to the xxx_interop functions that return char *'s, so they also return the length. Saves an interop call to get the UTF-8 string length during conversion to a .NET string.
  • Reworked the whole interop.c thing into interop.h and reduced the code required to merge the main sqlite3 codebase.
  • Added support for user-defined collations.


SQLite Query Syntax
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

The SQLite library understands most of the standard SQL language. But it does omit some features while at the same time adding a few features of its own. This document attempts to describe precisely what parts of the SQL language SQLite does and does not support. A list of keywords is also provided. In all of the syntax diagrams that follow, literal text is shown in bold blue. Non-terminal symbols are shown in italic red. Operators that are part of the syntactic markup itself are shown in black roman. This document is just an overview of the SQL syntax implemented by SQLite.

SQLite implements the follow syntax:

ALTER TABLE
ANALYZE
ATTACH DATABASE
BEGIN TRANSACTION
comment
COMMIT TRANSACTION
CREATE INDEX
CREATE TABLE
CREATE TRIGGER
CREATE VIEW
CREATE VIRTUAL TABLE
DELETE
DETACH DATABASE
DROP INDEX
DROP TABLE
DROP TRIGGER
DROP VIEW
END TRANSACTION
EXPLAIN
expression
INSERT
ON CONFLICT clause
PRAGMA
REINDEX
REPLACE
ROLLBACK TRANSACTION
SELECT
TYPES
UPDATE
VACUUM


ALTER TABLE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

ALTER TABLE

sql-statement ::= | ALTER TABLE [database-name .] table-name alteration
alteration ::= | RENAME TO new-table-name
alteration ::= | ADD [COLUMN] column-def

SQLite's version of the ALTER TABLE command allows the user to rename or add a new column to an existing table. It is not possible to remove a column from a table.

The RENAME TO syntax is used to rename the table identified by [database-name.]table-name to new-table-name. This command cannot be used to move a table between attached databases, only to rename a table within the same database.

If the table being renamed has triggers or indices, then these remain attached to the table after it has been renamed. However, if there are any view definitions, or statements executed by triggers that refer to the table being renamed, these are not automatically modified to use the new table name. If this is required, the triggers or view definitions must be dropped and recreated to use the new table name by hand.

The ADD [COLUMN] syntax is used to add a new column to an existing table. The new column is always appended to the end of the list of existing columns. Column-def may take any of the forms permissable in a CREATE TABLE statement, with the following restrictions:

  • The column may not have a PRIMARY KEY or UNIQUE constraint.
  • The column may not have a default value of CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP.
  • If a NOT NULL constraint is specified, then the column must have a default value other than NULL.

The execution time of the ALTER TABLE command is independent of the amount of data in the table. The ALTER TABLE command runs as quickly on a table with 10 million rows as it does on a table with 1 row.

After ADD COLUMN has been run on a database, that database will not be readable by SQLite version 3.1.3 and earlier until the database is VACUUMed.


ANALYZE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

ANALYZE

sql-statement ::= ANALYZE
sql-statement ::= ANALYZE database-name
sql-statement ::= ANALYZE [database-name .] table-name

The ANALYZE command gathers statistics about indices and stores them in a special tables in the database where the query optimizer can use them to help make better index choices. If no arguments are given, all indices in all attached databases are analyzed. If a database name is given as the argument, all indices in that one database are analyzed. If the argument is a table name, then only indices associated with that one table are analyzed.

The initial implementation stores all statistics in a single table named sqlite_stat1. Future enhancements may create additional tables with the same name pattern except with the "1" changed to a different digit. The sqlite_stat1 table cannot be DROPped, but all the content can be DELETEd which has the same effect.


ATTACH DATABASE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

ATTACH DATABASE

sql-statement ::= ATTACH [DATABASE] database-filename AS database-name

The ATTACH DATABASE statement adds another database file to the current database connection. If the filename contains punctuation characters it must be quoted. The names 'main' and 'temp' refer to the main database and the database used for temporary tables. These cannot be detached. Attached databases are removed using the DETACH DATABASE statement.

You can read from and write to an attached database and you can modify the schema of the attached database. This is a new feature of SQLite version 3.0. In SQLite 2.8, schema changes to attached databases were not allowed.

You cannot create a new table with the same name as a table in an attached database, but you can attach a database which contains tables whose names are duplicates of tables in the main database. It is also permissible to attach the same database file multiple times.

Tables in an attached database can be referred to using the syntax database-name.table-name. If an attached table doesn't have a duplicate table name in the main database, it doesn't require a database name prefix. When a database is attached, all of its tables which don't have duplicate names become the default table of that name. Any tables of that name attached afterwards require the table prefix. If the default table of a given name is detached, then the last table of that name attached becomes the new default.

Transactions involving multiple attached databases are atomic, assuming that the main database is not ":memory:". If the main database is ":memory:" then transactions continue to be atomic within each individual database file. But if the host computer crashes in the middle of a COMMIT where two or more database files are updated, some of those files might get the changes where others might not. Atomic commit of attached databases is a new feature of SQLite version 3.0. In SQLite version 2.8, all commits to attached databases behaved as if the main database were ":memory:".

There is a compile-time limit of 10 attached database files.


TRANSACTIONS

BEGIN TRANSACTION
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

BEGIN TRANSACTION

sql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]
sql-statement ::= END [TRANSACTION [name]]
sql-statement ::= COMMIT [TRANSACTION [name]]
sql-statement ::= ROLLBACK [TRANSACTION [name]]

Beginning in version 2.0, SQLite supports transactions with rollback and atomic commit.

The optional transaction name is ignored. SQLite currently does not allow nested transactions.

No changes can be made to the database except within a transaction. Any command that changes the database (basically, any SQL command other than SELECT) will automatically start a transaction if one is not already in effect. Automatically started transactions are committed at the conclusion of the command.

Transactions can be started manually using the BEGIN command. Such transactions usually persist until the next COMMIT or ROLLBACK command. But a transaction will also ROLLBACK if the database is closed or if an error occurs and the ROLLBACK conflict resolution algorithm is specified. See the documentation on the ON CONFLICT clause for additional information about the ROLLBACK conflict resolution algorithm.

In SQLite version 3.0.8 and later, transactions can be deferred, immediate, or exclusive. Deferred means that no locks are acquired on the database until the database is first accessed. Thus with a deferred transaction, the BEGIN statement itself does nothing. Locks are not acquired until the first read or write operation. The first read operation against a database creates a SHARED lock and the first write operation creates a RESERVED lock. Because the acquisition of locks is deferred until they are needed, it is possible that another thread or process could create a separate transaction and write to the database after the BEGIN on the current thread has executed. If the transaction is immediate, then RESERVED locks are acquired on all databases as soon as the BEGIN command is executed, without waiting for the database to be used. After a BEGIN IMMEDIATE, you are guaranteed that no other thread or process will be able to write to the database or do a BEGIN IMMEDIATE or BEGIN EXCLUSIVE. Other processes can continue to read from the database, however. An exclusive transaction causes EXCLUSIVE locks to be acquired on all databases. After a BEGIN EXCLUSIVE, you are guaranteed that no other thread or process will be able to read or write the database until the transaction is complete.

A description of the meaning of SHARED, RESERVED, and EXCLUSIVE locks is available separately.

The default behavior for SQLite version 3.0.8 is a deferred transaction. For SQLite version 3.0.0 through 3.0.7, deferred is the only kind of transaction available. For SQLite version 2.8 and earlier, all transactions are exclusive.

The COMMIT command does not actually perform a commit until all pending SQL commands finish. Thus if two or more SELECT statements are in the middle of processing and a COMMIT is executed, the commit will not actually occur until all SELECT statements finish.

An attempt to execute COMMIT might result in an SQLITE_BUSY return code. This indicates that another thread or process had a read lock on the database that prevented the database from being updated. When COMMIT fails in this way, the transaction remains active and the COMMIT can be retried later after the reader has had a chance to clear.


comment
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

comment

comment ::= | SQL-comment | C-comment
SQL-comment ::= | -- single-line
C-comment ::= | /* multiple-lines [*/]

Comments aren't SQL commands, but can occur in SQL queries. They are treated as whitespace by the parser. They can begin anywhere whitespace can be found, including inside expressions that span multiple lines.

SQL comments only extend to the end of the current line.

C comments can span any number of lines. If there is no terminating delimiter, they extend to the end of the input. This is not treated as an error. A new SQL statement can begin on a line after a multiline comment ends. C comments can be embedded anywhere whitespace can occur, including inside expressions, and in the middle of other SQL statements. C comments do not nest. SQL comments inside a C comment will be ignored.


CREATE INDEX
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

CREATE INDEX

sql-statement ::= | CREATE [UNIQUE] INDEX [IF NOT EXISTS] [database-name .] index-name ON table-name ( column-name [, column-name]* )
column-name ::= | name [ COLLATE collation-name] [ ASC | DESC ]

The CREATE INDEX command consists of the keywords "CREATE INDEX" followed by the name of the new index, the keyword "ON", the name of a previously created table that is to be indexed, and a parenthesized list of names of columns in the table that are used for the index key. Each column name can be followed by one of the "ASC" or "DESC" keywords to indicate sort order, but the sort order is ignored in the current implementation. Sorting is always done in ascending order.

The COLLATE clause following each column name defines a collating sequence used for text entires in that column. The default collating sequence is the collating sequence defined for that column in the CREATE TABLE statement. Or if no collating sequence is otherwise defined, the built-in BINARY collating sequence is used.

There are no arbitrary limits on the number of indices that can be attached to a single table, nor on the number of columns in an index.

If the UNIQUE keyword appears between CREATE and INDEX then duplicate index entries are not allowed. Any attempt to insert a duplicate entry will result in an error.

The exact text of each CREATE INDEX statement is stored in the sqlite_master or sqlite_temp_master table, depending on whether the table being indexed is temporary. Every time the database is opened, all CREATE INDEX statements are read from the sqlite_master table and used to regenerate SQLite's internal representation of the index layout.

If the optional IF NOT EXISTS clause is present and another index with the same name aleady exists, then this command becomes a no-op.

Indexes are removed with the DROP INDEX command.


CREATE TABLE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

CREATE TABLE

sql-command ::= | CREATE [TEMP | TEMPORARY] TABLE [IF NOT EXISTS] [database-name .] table-name ( column-def [, column-def]* [, constraint]* )
sql-command ::= | CREATE [TEMP | TEMPORARY] TABLE [database-name.] table-name AS select-statement
column-def ::= | name [type] [[CONSTRAINT name] column-constraint]*
type ::= | typename | typename ( number ) | typename ( number , number )
column-constraint ::= | NOT NULL [ conflict-clause ] | PRIMARY KEY [sort-order] [ conflict-clause ] [AUTOINCREMENT] | UNIQUE [ conflict-clause ] | CHECK ( expr ) | DEFAULT value | COLLATE collation-name
constraint ::= | PRIMARY KEY ( column-list ) [ conflict-clause ] | UNIQUE ( column-list ) [ conflict-clause ] | CHECK ( expr )
conflict-clause ::= | ON CONFLICT conflict-algorithm

A CREATE TABLE statement is basically the keywords "CREATE TABLE" followed by the name of a new table and a parenthesized list of column definitions and constraints. The table name can be either an identifier or a string. Tables names that begin with "sqlite_" are reserved for use by the engine.

Each column definition is the name of the column followed by the datatype for that column, then one or more optional column constraints. The datatype for the column does not restrict what data may be put in that column. See Datatypes In SQLite Version 3 for additional information. The UNIQUE constraint causes an index to be created on the specified columns. This index must contain unique keys. The COLLATE clause specifies what text collating function to use when comparing text entries for the column. The built-in BINARY collating function is used by default.

The DEFAULT constraint specifies a default value to use when doing an INSERT. The value may be NULL, a string constant or a number. Starting with version 3.1.0, the default value may also be one of the special case-independant keywords CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP. If the value is NULL, a string constant or number, it is literally inserted into the column whenever an INSERT statement that does not specify a value for the column is executed. If the value is CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP, then the current UTC date and/or time is inserted into the columns. For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, YYYY-MM-DD. The format for CURRENT_TIMESTAMP is "YYYY-MM-DD HH:MM:SS".

Specifying a PRIMARY KEY normally just creates a UNIQUE index on the corresponding columns. However, if primary key is on a single column that has datatype INTEGER, then that column is used internally as the actual key of the B-Tree for the table. This means that the column may only hold unique integer values. (Except for this one case, SQLite ignores the datatype specification of columns and allows any kind of data to be put in a column regardless of its declared datatype.) If a table does not have an INTEGER PRIMARY KEY column, then the B-Tree key will be a automatically generated integer. The B-Tree key for a row can always be accessed using one of the special names "ROWID", "OID", or "_ROWID_". This is true regardless of whether or not there is an INTEGER PRIMARY KEY. An INTEGER PRIMARY KEY column man also include the keyword AUTOINCREMENT. The AUTOINCREMENT keyword modified the way that B-Tree keys are automatically generated. Additional detail on automatic B-Tree key generation is available separately.

If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" and "TABLE" then the table that is created is only visible within that same database connection and is automatically deleted when the database connection is closed. Any indices created on a temporary table are also temporary. Temporary tables and indices are stored in a separate file distinct from the main database file.

If a <database-name> is specified, then the table is created in the named database. It is an error to specify both a <database-name> and the TEMP keyword, unless the <database-name> is "temp". If no database name is specified, and the TEMP keyword is not present, the table is created in the main database.

The optional conflict-clause following each constraint allows the specification of an alternative default constraint conflict resolution algorithm for that constraint. The default is abort ABORT. Different constraints within the same table may have different default conflict resolution algorithms. If an COPY, INSERT, or UPDATE command specifies a different conflict resolution algorithm, then that algorithm is used in place of the default algorithm specified in the CREATE TABLE statement. See the section titled ON CONFLICT for additional information.

CHECK constraints are supported as of version 3.3.0. Prior to version 3.3.0, CHECK constraints were parsed but not enforced.

There are no arbitrary limits on the number of columns or on the number of constraints in a table. The total amount of data in a single row is limited to about 1 megabytes in version 2.8. In version 3.0 there is no arbitrary limit on the amount of data in a row.

The CREATE TABLE AS form defines the table to be the result set of a query. The names of the table columns are the names of the columns in the result.

The exact text of each CREATE TABLE statement is stored in the sqlite_master table. Every time the database is opened, all CREATE TABLE statements are read from the sqlite_master table and used to regenerate SQLite's internal representation of the table layout. If the original command was a CREATE TABLE AS then then an equivalent CREATE TABLE statement is synthesized and store in sqlite_master in place of the original command. The text of CREATE TEMPORARY TABLE statements are stored in the sqlite_temp_master table.

If the optional IF NOT EXISTS clause is present and another table with the same name aleady exists, then this command becomes a no-op.

Tables are removed using the DROP TABLE statement.


CREATE TABLE

CREATE TRIGGER
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

CREATE TRIGGER

sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER trigger-name [ BEFORE | AFTER ]
database-event ON [database-name .] table-name
trigger-action
sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER trigger-name INSTEAD OF
database-event ON [database-name .] view-name
trigger-action
database-event ::= DELETE |
INSERT |
UPDATE |
UPDATE OF column-list
trigger-action ::= [ FOR EACH ROW | FOR EACH STATEMENT ] [ WHEN expression ]
BEGIN
trigger-step ; [ trigger-step ; ]*
END
trigger-step ::= update-statement | insert-statement |
delete-statement | select-statement

The CREATE TRIGGER statement is used to add triggers to the database schema. Triggers are database operations (the trigger-action) that are automatically performed when a specified database event (the database-event) occurs.

A trigger may be specified to fire whenever a DELETE, INSERT or UPDATE of a particular database table occurs, or whenever an UPDATE of one or more specified columns of a table are updated.

At this time SQLite supports only FOR EACH ROW triggers, not FOR EACH STATEMENT triggers. Hence explicitly specifying FOR EACH ROW is optional. FOR EACH ROW implies that the SQL statements specified as trigger-steps may be executed (depending on the WHEN clause) for each database row being inserted, updated or deleted by the statement causing the trigger to fire.

Both the WHEN clause and the trigger-steps may access elements of the row being inserted, deleted or updated using references of the form "NEW.column-name" and "OLD.column-name", where column-name is the name of a column from the table that the trigger is associated with. OLD and NEW references may only be used in triggers on trigger-events for which they are relevant, as follows:

INSERT | NEW references are valid
UPDATE | NEW and OLD references are valid
DELETE | OLD references are valid

If a WHEN clause is supplied, the SQL statements specified as trigger-steps are only executed for rows for which the WHEN clause is true. If no WHEN clause is supplied, the SQL statements are executed for all rows.

The specified trigger-time determines when the trigger-steps will be executed relative to the insertion, modification or removal of the associated row.

An ON CONFLICT clause may be specified as part of an UPDATE or INSERT trigger-step. However if an ON CONFLICT clause is specified as part of the statement causing the trigger to fire, then this conflict handling policy is used instead.

Triggers are automatically dropped when the table that they are associated with is dropped.

Triggers may be created on views, as well as ordinary tables, by specifying INSTEAD OF in the CREATE TRIGGER statement. If one or more ON INSERT, ON DELETE or ON UPDATE triggers are defined on a view, then it is not an error to execute an INSERT, DELETE or UPDATE statement on the view, respectively. Thereafter, executing an INSERT, DELETE or UPDATE on the view causes the associated triggers to fire. The real tables underlying the view are not modified (except possibly explicitly, by a trigger program).

Example:

Assuming that customer records are stored in the "customers" table, and that order records are stored in the "orders" table, the following trigger ensures that all associated orders are redirected when a customer changes his or her address:

CREATE TRIGGER update_customer_address UPDATE OF address ON customers
  BEGIN
    UPDATE orders SET address = new.address WHERE customer_name = old.name;
  END;

With this trigger installed, executing the statement:

UPDATE customers SET address = '1 Main St.' WHERE name = 'Jack Jones';

causes the following to be automatically executed:

UPDATE orders SET address = '1 Main St.' WHERE customer_name = 'Jack Jones';

Note that currently, triggers may behave oddly when created on tables with INTEGER PRIMARY KEY fields. If a BEFORE trigger program modifies the INTEGER PRIMARY KEY field of a row that will be subsequently updated by the statement that causes the trigger to fire, then the update may not occur. The workaround is to declare the table with a PRIMARY KEY column instead of an INTEGER PRIMARY KEY column.

A special SQL function RAISE() may be used within a trigger-program, with the following syntax

raise-function ::= RAISE ( ABORT, error-message ) |
RAISE ( FAIL, error-message ) |
RAISE ( ROLLBACK, error-message ) |
RAISE ( IGNORE )

When one of the first three forms is called during trigger-program execution, the specified ON CONFLICT processing is performed (either ABORT, FAIL or ROLLBACK) and the current query terminates. An error code of SQLITE_CONSTRAINT is returned to the user, along with the specified error message.

When RAISE(IGNORE) is called, the remainder of the current trigger program, the statement that caused the trigger program to execute and any subsequent trigger programs that would of been executed are abandoned. No database changes are rolled back. If the statement that caused the trigger program to execute is itself part of a trigger program, then that trigger program resumes execution at the beginning of the next step.

Triggers are removed using the DROP TRIGGER statement.


CREATE VIEW
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

CREATE VIEW

sql-command ::= CREATE [TEMP | TEMPORARY] VIEW [database-name.] view-name AS select-statement

The CREATE VIEW command assigns a name to a pre-packaged SELECT statement. Once the view is created, it can be used in the FROM clause of another SELECT in place of a table name.

If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" and "VIEW" then the view that is created is only visible to the process that opened the database and is automatically deleted when the database is closed.

If a <database-name> is specified, then the view is created in the named database. It is an error to specify both a <database-name> and the TEMP keyword, unless the <database-name> is "temp". If no database name is specified, and the TEMP keyword is not present, the table is created in the main database.

You cannot COPY, DELETE, INSERT or UPDATE a view. Views are read-only in SQLite. However, in many cases you can use a TRIGGER on the view to accomplish the same thing. Views are removed with the DROP VIEW command.


CREATE VIRTUAL TABLE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

CREATE VIRTUAL TABLE

sql-command ::= CREATE VIRTUAL TABLE [database-name .] table-name USING module-name [( arguments )]

A virtual table is an interface to an external storage or computation engine that appears to be a table but does not actually store information in the database file.

In general, you can do anything with a virtual table that can be done with an ordinary table, except that you cannot create triggers on a virtual table. Some virtual table implementations might impose additional restrictions. For example, many virtual tables are read-only.

The <module-name> is the name of an object that implements the virtual table. The <module-name> must be registered with the SQLite database connection using sqlite3_create_module prior to issuing the CREATE VIRTUAL TABLE statement. The module takes zero or more comma-separated arguments. The arguments can be just about any text as long as it has balanced parentheses. The argument syntax is sufficiently general that the arguments can be made to appear as column definitions in a traditional CREATE TABLE statement. SQLite passes the module arguments directly to the module without any interpretation. It is the responsibility of the module implementation to parse and interpret its own arguments.

A virtual table is destroyed using the ordinary DROP TABLE statement. There is no DROP VIRTUAL TABLE statement.


DELETE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DELETE

sql-statement ::= DELETE FROM [database-name .] table-name [WHERE expr]

The DELETE command is used to remove records from a table. The command consists of the "DELETE FROM" keywords followed by the name of the table from which records are to be removed.

Without a WHERE clause, all rows of the table are removed. If a WHERE clause is supplied, then only those rows that match the expression are removed.


DETACH
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DETACH

sql-command ::= DETACH [DATABASE] database-name

This statement detaches an additional database connection previously attached using the ATTACH DATABASE statement. It is possible to have the same database file attached multiple times using different names, and detaching one connection to a file will leave the others intact.

This statement will fail if SQLite is in the middle of a transaction.


DROP INDEX
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DROP INDEX

sql-command ::= DROP INDEX [IF EXISTS] [database-name .] index-name

The DROP INDEX statement removes an index added with the CREATE INDEX statement. The index named is completely removed from the disk. The only way to recover the index is to reenter the appropriate CREATE INDEX command.

The DROP INDEX statement does not reduce the size of the database file in the default mode. Empty space in the database is retained for later INSERTs. To remove free space in the database, use the VACUUM command. If AUTOVACUUM mode is enabled for a database then space will be freed automatically by DROP INDEX.


DROP TABLE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DROP TABLE

sql-command ::= DROP TABLE [IF EXISTS] [database-name.] table-name

The DROP TABLE statement removes a table added with the CREATE TABLE statement. The name specified is the table name. It is completely removed from the database schema and the disk file. The table can not be recovered. All indices associated with the table are also deleted.

The DROP TABLE statement does not reduce the size of the database file in the default mode. Empty space in the database is retained for later INSERTs. To remove free space in the database, use the VACUUM command. If AUTOVACUUM mode is enabled for a database then space will be freed automatically by DROP TABLE.

The optional IF EXISTS clause suppresses the error that would normally result if the table does not exist.


DROP TRIGGER
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DROP TRIGGER

sql-statement ::= DROP TRIGGER [database-name .] trigger-name

The DROP TRIGGER statement removes a trigger created by the CREATE TRIGGER statement. The trigger is deleted from the database schema. Note that triggers are automatically dropped when the associated table is dropped.


DROP VIEW
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

DROP VIEW

sql-command ::= DROP VIEW view-name

The DROP VIEW statement removes a view created by the CREATE VIEW statement. The name specified is the view name. It is removed from the database schema, but no actual data in the underlying base tables is modified.


EXPLAIN
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

EXPLAIN

sql-statement ::= EXPLAIN sql-statement

The EXPLAIN command modifier is a non-standard extension. The idea comes from a similar command found in PostgreSQL, but the operation is completely different.

If the EXPLAIN keyword appears before any other SQLite SQL command then instead of actually executing the command, the SQLite library will report back the sequence of virtual machine instructions it would have used to execute the command had the EXPLAIN keyword not been present. For additional information about virtual machine instructions see the architecture description or the documentation on available opcodes for the virtual machine.


expression
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

expression

expr ::= | expr binary-op expr | expr [NOT] like-op expr [ESCAPE expr] | unary-op expr | ( expr ) | column-name | table-name . column-name | database-name . table-name . column-name | literal-value | parameter | function-name ( expr-list | * ) | expr ISNULL | expr NOTNULL | expr [NOT] BETWEEN expr AND expr | expr [NOT] IN ( value-list ) | expr [NOT] IN ( select-statement ) | expr [NOT] IN [database-name .] table-name | [EXISTS] ( select-statement ) | CASE [expr] ( WHEN expr THEN expr )+ [ELSE expr] END | CAST ( expr AS type )
like-op ::= | LIKE | GLOB | REGEXP | MATCH

This section is different from the others. Most other sections of this document talks about a particular SQL command. This section does not talk about a standalone command but about "expressions" which are subcomponents of most other commands.

SQLite understands the following binary operators, in order from highest to lowest precedence:

|| * / % + - << >> & | < <= >
  >= = == != <> IN AND OR

Supported unary operators are these:

- + ! ~ NOT

The unary operator [Operator +] is a no-op. It can be applied to strings, numbers, or blobs and it always gives as its result the value of the operand.

Note that there are two variations of the equals and not equals operators. Equals can be either = or ==. The non-equals operator can be either != or <>. The || operator is "concatenate" - it joins together the two strings of its operands. The operator % outputs the remainder of its left operand modulo its right operand.

The result of any binary operator is a numeric value, except for the || concatenation operator which gives a string result.

A literal value is an integer number or a floating point number. Scientific notation is supported. The "." character is always used as the decimal point even if the locale setting specifies "," for this role - the use of "," for the decimal point would result in syntactic ambiguity. A string constant is formed by enclosing the string in single quotes ('). A single quote within the string can be encoded by putting two single quotes in a row - as in Pascal. C-style escapes using the backslash character are not supported because they are not standard SQL. BLOB literals are string literals containing hexadecimal data and preceded by a single "x" or "X" character. For example:

X'53514697465'

A literal value can also be the token "NULL".

A parameter specifies a placeholder in the expression for a literal value that is filled in at runtime using the sqlite3_bind API. Parameters can take several forms:

?NNN | A question mark followed by a number NNN holds a spot for the NNN-th parameter. NNN must be between 1 and 999.
? | A question mark that is not followed by a number holds a spot for the next unused parameter.
:AAAA | A colon followed by an identifier name holds a spot for a named parameter with the name AAAA. Named parameters are also numbered. The number assigned is the next unused number. To avoid confusion, it is best to avoid mixing named and numbered parameters.
@AAAA | An "at" sign works exactly like a colon.
$AAAA | A dollar-sign followed by an identifier name also holds a spot for a named parameter with the name AAAA. The identifier name in this case can include one or more occurances of "::" and a suffix enclosed in "(...)" containing any text at all. This syntax is the form of a variable name in the Tcl programming language.

Parameters that are not assigned values using sqlite3_bind are treated as NULL.

The LIKE operator does a pattern matching comparison. The operand to the right contains the pattern, the left hand operand contains the string to match against the pattern. A percent symbol % in the pattern matches any sequence of zero or more characters in the string. An underscore _ in the pattern matches any single character in the string. Any other character matches itself or it's lower/upper case equivalent (i.e. case-insensitive matching). (A bug: SQLite only understands upper/lower case for 7-bit Latin characters. Hence the LIKE operator is case sensitive for 8-bit iso8859 characters or UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.).

If the optional ESCAPE clause is present, then the expression following the ESCAPE keyword must evaluate to a string consisting of a single character. This character may be used in the LIKE pattern to include literal percent or underscore characters. The escape character followed by a percent symbol, underscore or itself matches a literal percent symbol, underscore or escape character in the string, respectively. The infix LIKE operator is implemented by calling the user function like(X,Y).

The LIKE operator is not case sensitive and will match upper case characters on one side against lower case characters on the other. (A bug: SQLite only understands upper/lower case for 7-bit Latin characters. Hence the LIKE operator is case sensitive for 8-bit iso8859 characters or UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.).

The infix LIKE operator is implemented by calling the user function like(X,Y). If an ESCAPE clause is present, it adds a third parameter to the function call. If the functionality of LIKE can be overridden by defining an alternative implementation of the like() SQL function.

The GLOB operator is similar to LIKE but uses the Unix file globbing syntax for its wildcards. Also, GLOB is case sensitive, unlike LIKE. Both GLOB and LIKE may be preceded by the NOT keyword to invert the sense of the test. The infix GLOB operator is implemented by calling the user function glob(X,Y) and can be modified by overriding that function.

The REGEXP operator is a special syntax for the regexp() user function. No regexp() user function is defined by default and so use of the REGEXP operator will normally result in an error message. If a user-defined function named "regexp" is added at run-time, that function will be called in order to implement the REGEXP operator.

The MATCH operator is a special syntax for the match() user function. The default match() function implementation raises and exception and is not really useful for anything. But extensions can override the match() function with more helpful logic.

A column name can be any of the names defined in the CREATE TABLE statement or one of the following special identifiers: "ROWID", "OID", or "_ROWID_". These special identifiers all describe the unique random integer key (the "row key") associated with every row of every table. The special identifiers only refer to the row key if the CREATE TABLE statement does not define a real column with the same name. Row keys act like read-only columns. A row key can be used anywhere a regular column can be used, except that you cannot change the value of a row key in an UPDATE or INSERT statement. "SELECT * ..." does not return the row key.

SELECT statements can appear in expressions as either the right-hand operand of the IN operator, as a scalar quantity, or as the operand of an EXISTS operator. As a scalar quantity or the operand of an IN operator, the SELECT should have only a single column in its result. Compound SELECTs (connected with keywords like UNION or EXCEPT) are allowed. With the EXISTS operator, the columns in the result set of the SELECT are ignored and the expression returns TRUE if one or more rows exist and FALSE if the result set is empty. If no terms in the SELECT expression refer to value in the containing query, then the expression is evaluated once prior to any other processing and the result is reused as necessary. If the SELECT expression does contain variables from the outer query, then the SELECT is reevaluated every time it is needed.

When a SELECT is the right operand of the IN operator, the IN operator returns TRUE if the result of the left operand is any of the values generated by the select. The IN operator may be preceded by the NOT keyword to invert the sense of the test.

When a SELECT appears within an expression but is not the right operand of an IN operator, then the first row of the result of the SELECT becomes the value used in the expression. If the SELECT yields more than one result row, all rows after the first are ignored. If the SELECT yields no rows, then the value of the SELECT is NULL.

A CAST expression changes the datatype of the into the type specified by <type>. <type> can be any non-empty type name that is valid for the type in a column definition of a CREATE TABLE statement.

Both simple and aggregate functions are supported. A simple function can be used in any expression. Simple functions return a result immediately based on their inputs. Aggregate functions may only be used in a SELECT statement. Aggregate functions compute their result across all rows of the result set.

Core Functions

The core functions shown below are available by default. Additional functions may be written in C and added to the database engine using the sqlite3_create_function() API.

abs(X) | Return the absolute value of argument X.
acos(X) | A mathematical function that returns the angle, in radians, whose cosine is the specified double expression
acosh(X) | Inverse hyperbolic cosine
asin(X) | Returns the angle, in radians, whose sine is the specified double expression
asinh(X) | Inverse hyperbolic sine
atan(X) | Returns the angle in radians whose tangent is a specified double expression
atanh(X) | Inverse hyperbolic tangent
atn2(X,Y)
atan2(X,Y) 		Returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified double expressions
ceil(X)
ceiling(X) 		Returns the smallest integer greater than, or equal to, the specified numeric expression
charindex(X,Y[,Z]) | Returns the 1-based position of the string X inside the string Y starting at position Z. Returns 0 if not X is not found within Y.
coalesce(X,Y,...) | Return a copy of the first non-NULL argument. If all arguments are NULL then NULL is returned. There must be at least 2 arguments.
cos(X) | a mathematical function that returns the trigonometric cosine of the specified angle, in radians, in the specified expression
cosh(X) | Hyperbolic cosine
cot(X) | A mathematical function that returns the trigonometric cotangent of the specified angle, in radians, in the specified double expression
coth(X) | Hyperbolic cotangent
difference(X,Y) | Returns an integer value that indicates the difference between the SOUNDEX values of two character expressions
degrees(X) | Converts radians to degrees
exp(X) | Returns the exponential value of the specified expression
floor(X) | Returns the largest integer less than or equal to the specified numeric expression
glob(X,Y) | This function is used to implement the "X GLOB Y" syntax of SQLite. The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the GLOB operator.
ifnull(X,Y) | Return a copy of the first non-NULL argument. If both arguments are NULL then NULL is returned. This behaves the same as coalesce() above.
last_insert_rowid() | Return the ROWID of the last row insert from this connection to the database. This is the same value that would be returned from the sqlite_last_insert_rowid() API function.
last_rows_affected() | Returns the number of rows affected by the last insert/update operation
leftstr(X,Y) | Returns the leftmost Y characters in string X.
length(X) | Return the string length of X in characters. If SQLite is configured to support UTF-8, then the number of UTF-8 characters is returned, not the number of bytes.
like(X,Y [,Z]) | This function is used to implement the "X LIKE Y [ESCAPE Z]" syntax of SQL. If the optional ESCAPE clause is present, then the user-function is invoked with three arguments. Otherwise, it is invoked with two arguments only. The sqlite_create_function() interface can be used to override this function and thereby change the operation of the LIKE operator. When doing this, it may be important to override both the two and three argument versions of the like() function. Otherwise, different code may be called to implement the LIKE operator depending on whether or not an ESCAPE clause was specified.
load_extension(X)
load_extension(X,Y) 		Load SQLite extensions out of the shared library file named X using the entry point Y. The result is a NULL. If Y is omitted then the default entry point of sqlite3_extension_init is used. This function raises an exception if the extension fails to load or initialize correctly.
log(X) | Returns the natural logarithm of the specified double expression
log10(X) | Returns the base-10 logarithm of the specified double expression
lower(X) | Return a copy of string X will all characters converted to lower case. The C library tolower() routine is used for the conversion, which means that this function might not work correctly on UTF-8 characters.
max(X,Y,...) | Return the argument with the maximum value. Arguments may be strings in addition to numbers. The maximum value is determined by the usual sort order. Note that max() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.
min(X,Y,...) | Return the argument with the minimum value. Arguments may be strings in addition to numbers. The minimum value is determined by the usual sort order. Note that min() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.
nullif(X,Y) | Return the first argument if the arguments are different, otherwise return NULL.
padc(X,Y) | Pads the given string X on the left and the right with spaces until it is the specified length Y
padl(X,Y) | Pads the given string X on the left with spaces until it is the specified length Y
padr(X,Y) | Pads the given string X on the right with spaces until it is the specified length Y
pi | Returns the value of pi
power(X,Y) | Returns the value of the specified expression X to the specified power Y
proper(X) | Proper-case the given string X
quote(X) | This routine returns a string which is the value of its argument suitable for inclusion into another SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. BLOBs are encoded as hexadecimal literals. The current implementation of VACUUM uses this function. The function is also useful when writing triggers to implement undo/redo functionality.
radians(X) | Converts degrees to radians
random(*) | Return a pseudo-random integer between -9223372036854775808 and +9223372036854775807.
replace(X,Y,Z) | Replace all occurances of Y inside string X with the replacement text Z. Case-sensitive.
replicate(X,Y) | Return the concatenation of string X repeated Y times
reverse(X) | Returns the string X reversed
rightstr(X,Y) | Returns the right-most Y characters in string X.
round(X)
round(X,Y) 		Round off the number X to Y digits to the right of the decimal point. If the Y argument is omitted, 0 is assumed.
sign(X) | Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression
sin(X) | Returns the trigonometric sine of the specified angle, in radians, and in an approximate numeric, double, expression
soundex(X) | Compute the soundex encoding of the string X. The string "?000" is returned if the argument is NULL.
sqlite_version(*) | Return the version string for the SQLite library that is running. Example: "3.6.0"
sqrt(X) | Returns the square root of the specified value
square(X) | Returns the square of the specified value
strfilter(X,Y) | Given a source string X and the characters to filter Y, returns X with all characters not found in Y removed.
substr(X,Y,Z) | Return a substring of input string X that begins with the Y-th character and which is Z characters long. The left-most character of X is number 1. If Y is negative the the first character of the substring is found by counting from the right rather than the left. If SQLite is configured to support UTF-8, then characters indices refer to actual UTF-8 characters, not bytes.
tan(X) | Returns the tangent of the input expression
tanh(X) | Hyperbolic tangent
typeof(X) | Return the type of the expression X. The only return values are "null", "integer", "real", "text", and "blob". SQLite's type handling is explained in Datatypes in SQLite Version 3.
upper(X) | Return a copy of input string X converted to all upper-case letters. The implementation of this function uses the C library routine toupper() which means it may not work correctly on UTF-8 strings.

Aggregate Functions

The aggregate functions shown below are available by default. Additional aggregate functions written in C may be added using the sqlite3_create_function() API.

In any aggregate function that takes a single argument, that argument can be preceeded by the keyword DISTINCT. In such cases, duplicate elements are filtered before being passed into the aggregate function. For example, the function "count(distinct X)" will return the number of distinct values of column X instead of the total number of non-null values in column X.

avg(X) Return the average value of all non-NULL X within a group. String and BLOB values that do not look like numbers are interpreted as 0. The result of avg() is always a floating point value even if all inputs are integers.

count(X)
count(*) 		The first form return a count of the number of times that X is not NULL in a group. The second form (with no argument) returns the total number of rows in the group.
lower_quartile(X) | Returns the lower quartile of the given numbers in the set
max(X) | Return the maximum value of all values in the group. The usual sort order is used to determine the maximum.
median(X) | Returns the middle value in a set of ordered numbers. (The medial value is unlike the mean value, which is the sum of a set of numbers divided by the count of numbers in the set). The median value is determined by choosing the smallest value such that at least half of the values in the set are no greater than the chosen value. If the number of values within the set is odd, the median value corresponds to a single value. If the number of values within the set is even, the median value corresponds to the sum of the two middle values divided by two.
min(X) | Return the minimum non-NULL value of all values in the group. The usual sort order is used to determine the minimum. NULL is only returned if all values in the group are NULL.
mode(X) | Computes the most frequently occurring value in a sample set
stdev(X) | Returns the statistical standard deviation of all values in the specified expression
sum(X)
total(X) 		Return the numeric sum of all non-NULL values in the group. If there are no non-NULL input rows then sum() returns NULL but total() returns 0.0. NULL is not normally a helpful result for the sum of no rows but the SQL standard requires it and most other SQL database engines implement sum() that way so SQLite does it in the same way in order to be compatible. The non-standard total() function is provided as a convenient way to work around this design problem in the SQL language.

The result of total() is always a floating point value. The result of sum() is an integer value if all non-NULL inputs are integers. If any input to sum() is neither an integer or a NULL then sum() returns a floating point value which might be an approximation to the true sum.

Sum() will throw an "integer overflow" exception if all inputs are integers or NULL and an integer overflow occurs at any point during the computation. Total() never throws an exception.
upper_quartile(X) | Returns the upper quartile of the numbers in the given set


INSERT
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

INSERT

sql-statement ::= INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] VALUES(value-list) |
INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] select-statement

The INSERT statement comes in two basic forms. The first form (with the "VALUES" keyword) creates a single new row in an existing table. If no column-list is specified then the number of values must be the same as the number of columns in the table. If a column-list is specified, then the number of values must match the number of specified columns. Columns of the table that do not appear in the column list are filled with the default value, or with NULL if not default value is specified.

The second form of the INSERT statement takes it data from a SELECT statement. The number of columns in the result of the SELECT must exactly match the number of columns in the table if no column list is specified, or it must match the number of columns name in the column list. A new entry is made in the table for every row of the SELECT result. The SELECT may be simple or compound. If the SELECT statement has an ORDER BY clause, the ORDER BY is ignored.

The optional conflict-clause allows the specification of an alternative constraint conflict resolution algorithm to use during this one command. See the section titled ON CONFLICT for additional information. For compatibility with MySQL, the parser allows the use of the single keyword REPLACE as an alias for "INSERT OR REPLACE".


ON CONFLICT

ON CONFLICT clause
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

ON CONFLICT clause

conflict-clause ::= | ON CONFLICT conflict-algorithm
conflict-algorithm ::= | ROLLBACK | ABORT | FAIL | IGNORE | REPLACE

The ON CONFLICT clause is not a separate SQL command. It is a non-standard clause that can appear in many other SQL commands. It is given its own section in this document because it is not part of standard SQL and therefore might not be familiar.

The syntax for the ON CONFLICT clause is as shown above for the CREATE TABLE command. For the INSERT and UPDATE commands, the keywords "ON CONFLICT" are replaced by "OR", to make the syntax seem more natural. For example, instead of "INSERT ON CONFLICT IGNORE" we have "INSERT OR IGNORE". The keywords change but the meaning of the clause is the same either way.

The ON CONFLICT clause specifies an algorithm used to resolve constraint conflicts. There are five choices: ROLLBACK, ABORT, FAIL, IGNORE, and REPLACE. The default algorithm is ABORT. This is what they mean:

ROLLBACK

When a constraint violation occurs, an immediate ROLLBACK occurs, thus ending the current transaction, and the command aborts with a return code of SQLITE_CONSTRAINT. If no transaction is active (other than the implied transaction that is created on every command) then this algorithm works the same as ABORT.

ABORT

When a constraint violation occurs, the command backs out any prior changes it might have made and aborts with a return code of SQLITE_CONSTRAINT. But no ROLLBACK is executed so changes from prior commands within the same transaction are preserved. This is the default behavior.

FAIL

When a constraint violation occurs, the command aborts with a return code SQLITE_CONSTRAINT. But any changes to the database that the command made prior to encountering the constraint violation are preserved and are not backed out. For example, if an UPDATE statement encountered a constraint violation on the 100th row that it attempts to update, then the first 99 row changes are preserved but changes to rows 100 and beyond never occur.

IGNORE

When a constraint violation occurs, the one row that contains the constraint violation is not inserted or changed. But the command continues executing normally. Other rows before and after the row that contained the constraint violation continue to be inserted or updated normally. No error is returned.

REPLACE

When a UNIQUE constraint violation occurs, the pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row. Thus the insert or update always occurs. The command continues executing normally. No error is returned. If a NOT NULL constraint violation occurs, the NULL value is replaced by the default value for that column. If the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs then the IGNORE algorithm is used.

When this conflict resolution strategy deletes rows in order to satisfy a constraint, it does not invoke delete triggers on those rows. This behavior might change in a future release.

The algorithm specified in the OR clause of a INSERT or UPDATE overrides any algorithm specified in a CREATE TABLE. If no algorithm is specified anywhere, the ABORT algorithm is used.


PRAGMA
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

PRAGMA

The PRAGMA command is a special command used to modify the operation of the SQLite library or to query the library for internal (non-table) data. The PRAGMA command is issued using the same interface as other SQLite commands (e.g. SELECT, INSERT) but is different in the following important respects:

  • Specific pragma statements may be removed and others added in future releases of SQLite. Use with caution!
  • No error messages are generated if an unknown pragma is issued. Unknown pragmas are simply ignored. This means if there is a typo in a pragma statement the library does not inform the user of the fact.
  • Some pragmas take effect during the SQL compilation stage, not the execution stage. This means if using the C-language sqlite3_compile(), sqlite3_step(), sqlite3_finalize() API (or similar in a wrapper interface), the pragma may be applied to the library during the sqlite3_compile() call.
  • The pragma command is unlikely to be compatible with any other SQL engine.

The available pragmas fall into four basic categories:

  • Pragmas used to query the schema of the current database.
  • Pragmas used to modify the operation of the SQLite library in some manner, or to query for the current mode of operation.
  • Pragmas used to query or modify the databases two version values, the schema-version and the user-version.
  • Pragmas used to debug the library and verify that database files are not corrupted.

PRAGMA command syntax

sql-statement ::= PRAGMA name [= value] |
PRAGMA function(arg)

The pragmas that take an integer value also accept symbolic names. The strings "on", "true", and "yes" are equivalent to 1. The strings "off", "false", and "no" are equivalent to 0. These strings are case- insensitive, and do not require quotes. An unrecognized string will be treated as 1, and will not generate an error. When the value is returned it is as an integer.

Pragmas to modify library operation

  • PRAGMA auto_vacuum;
    PRAGMA auto_vacuum =     0 | 1;

    Query or set the auto-vacuum flag in the database.

    Normally, when a transaction that deletes data from a database is committed, the database file remains the same size. Unused database file pages are marked as such and reused later on, when data is inserted into the database. In this mode the VACUUM command is used to reclaim unused space.

    When the auto-vacuum flag is set, the database file shrinks when a transaction that deletes data is committed (The VACUUM command is not useful in a database with the auto-vacuum flag set). To support this functionality the database stores extra information internally, resulting in slightly larger database files than would otherwise be possible.

    It is only possible to modify the value of the auto-vacuum flag before any tables have been created in the database. No error message is returned if an attempt to modify the auto-vacuum flag is made after one or more tables have been created.

  • PRAGMA cache_size;
    PRAGMA cache_size =     Number-of-pages;

    Query or change the maximum number of database disk pages that SQLite will hold in memory at once. Each page uses about 1.5K of memory. The default cache size is 2000. If you are doing UPDATEs or DELETEs that change many rows of a database and you do not mind if SQLite uses more memory, you can increase the cache size for a possible speed improvement.

    When you change the cache size using the cache_size pragma, the change only endures for the current session. The cache size reverts to the default value when the database is closed and reopened. Use the default_cache_size pragma to check the cache size permanently.

  • PRAGMA case_sensitive_like;
    PRAGMA case_sensitive_like =     0 | 1;

    The default behavior of the LIKE operator is to ignore case for latin1 characters. Hence, by default 'a' LIKE 'A' is true. The case_sensitive_like pragma can be turned on to change this behavior. When case_sensitive_like is enabled, 'a' LIKE 'A' is false but 'a' LIKE 'a' is still true.

  • PRAGMA count_changes;
    PRAGMA count_changes =     0 | 1;

    Query or change the count-changes flag. Normally, when the count-changes flag is not set, INSERT, UPDATE and DELETE statements return no data. When count-changes is set, each of these commands returns a single row of data consisting of one integer value - the number of rows inserted, modified or deleted by the command. The returned change count does not include any insertions, modifications or deletions performed by triggers.

  • PRAGMA default_cache_size;
    PRAGMA default_cache_size =     Number-of-pages;

    Query or change the maximum number of database disk pages that SQLite will hold in memory at once. Each page uses 1K on disk and about 1.5K in memory. This pragma works like the cache_size pragma with the additional feature that it changes the cache size persistently. With this pragma, you can set the cache size once and that setting is retained and reused every time you reopen the database.

  • PRAGMA default_synchronous;

    This pragma was available in version 2.8 but was removed in version 3.0. It is a dangerous pragma whose use is discouraged. To help dissuide users of version 2.8 from employing this pragma, the documentation will not tell you what it does.

  • PRAGMA empty_result_callbacks;
    PRAGMA empty_result_callbacks =     0 | 1;

    Query or change the empty-result-callbacks flag.

    The empty-result-callbacks flag affects the sqlite3_exec API only. Normally, when the empty-result-callbacks flag is cleared, the callback function supplied to the sqlite3_exec() call is not invoked for commands that return zero rows of data. When empty-result-callbacks is set in this situation, the callback function is invoked exactly once, with the third parameter set to 0 (NULL). This is to enable programs that use the sqlite3_exec() API to retrieve column-names even when a query returns no data.

  • PRAGMA encoding;
    PRAGMA encoding = "UTF-8";
    PRAGMA encoding = "UTF-16";
    PRAGMA encoding = "UTF-16le";
    PRAGMA encoding = "UTF-16be";

    In first form, if the main database has already been created, then this pragma returns the text encoding used by the main database, one of "UTF-8", "UTF-16le" (little-endian UTF-16 encoding) or "UTF-16be" (big-endian UTF-16 encoding). If the main database has not already been created, then the value returned is the text encoding that will be used to create the main database, if it is created by this session.

    The second and subsequent forms of this pragma are only useful if the main database has not already been created. In this case the pragma sets the encoding that the main database will be created with if it is created by this session. The string "UTF-16" is interpreted as "UTF-16 encoding using native machine byte-ordering". If the second and subsequent forms are used after the database file has already been created, they have no effect and are silently ignored.

    Once an encoding has been set for a database, it cannot be changed.

    Databases created by the ATTACH command always use the same encoding as the main database.

  • PRAGMA full_column_names;
    PRAGMA full_column_names =     0 | 1;

    Query or change the full-column-names flag. This flag affects the way SQLite names columns of data returned by SELECT statements when the expression for the column is a table-column name or the wildcard "*". Normally, such result columns are named <table-name/alias><column-name> if the SELECT statement joins two or more tables together, or simply <column-name> if the SELECT statement queries a single table. When the full-column-names flag is set, such columns are always named <table-name/alias> <column-name> regardless of whether or not a join is performed.

    If both the short-column-names and full-column-names are set, then the behaviour associated with the full-column-names flag is exhibited.

  • PRAGMA fullfsync
    PRAGMA fullfsync =     0 | 1;

    Query or change the fullfsync flag. This flag affects determines whether or not the F_FULLFSYNC syncing method is used on systems that support it. The default value is off. As of this writing (2006-02-10) only Mac OS X supports F_FULLFSYNC.

  • PRAGMA legacy_file_format;
    PRAGMA legacy_file_format = ON | OFF

    This pragma sets or queries the value of the legacy_file_format flag. When this flag is on, new SQLite databases are created in a file format that is readable and writable by all versions of SQLite going back to 3.0.0. When the flag is off, new databases are created using the latest file format which might to be readable or writable by older versions of SQLite.

    This flag only effects newly created databases. It has no effect on databases that already exists.

  • PRAGMA page_size;
    PRAGMA page_size =     bytes;

    Query or set the page-size of the database. The page-size may only be set if the database has not yet been created. The page size must be a power of two greater than or equal to 512 and less than or equal to 8192. The upper limit may be modified by setting the value of macro SQLITE_MAX_PAGE_SIZE during compilation. The maximum upper bound is 32768.

  • PRAGMA read_uncommitted;
    PRAGMA read_uncommitted =     0 | 1;

    Query, set, or clear READ UNCOMMITTED isolation. The default isolation level for SQLite is SERIALIZABLE. Any process or thread can select READ UNCOMMITTED isolation, but SERIALIZABLE will still be used except between connections that share a common page and schema cache. Cache sharing is enabled using the sqlite3_enable_shared_cache() API and is only available between connections running the same thread. Cache sharing is off by default.

  • PRAGMA short_column_names;
    PRAGMA short_column_names =     0 | 1;

    Query or change the short-column-names flag. This flag affects the way SQLite names columns of data returned by SELECT statements when the expression for the column is a table-column name or the wildcard "*". Normally, such result columns are named <table-name/alias>lt;column-name> if the SELECT statement joins two or more tables together, or simply <column-name> if the SELECT statement queries a single table. When the short-column-names flag is set, such columns are always named <column-name> regardless of whether or not a join is performed.

    If both the short-column-names and full-column-names are set, then the behaviour associated with the full-column-names flag is exhibited.

  • PRAGMA synchronous;
    PRAGMA synchronous = FULL;     (2)
    PRAGMA synchronous = NORMAL;     (1)
    PRAGMA synchronous = OFF;     (0)

    Query or change the setting of the "synchronous" flag. The first (query) form will return the setting as an integer. When synchronous is FULL (2), the SQLite database engine will pause at critical moments to make sure that data has actually been written to the disk surface before continuing. This ensures that if the operating system crashes or if there is a power failure, the database will be uncorrupted after rebooting. FULL synchronous is very safe, but it is also slow. When synchronous is NORMAL, the SQLite database engine will still pause at the most critical moments, but less often than in FULL mode. There is a very small (though non-zero) chance that a power failure at just the wrong time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. With synchronous OFF (0), SQLite continues without pausing as soon as it has handed data off to the operating system. If the application running SQLite crashes, the data will be safe, but the database might become corrupted if the operating system crashes or the computer loses power before that data has been written to the disk surface. On the other hand, some operations are as much as 50 or more times faster with synchronous OFF.

    In SQLite version 2, the default value is NORMAL. For version 3, the default was changed to FULL.

  • PRAGMA temp_store;
    PRAGMA temp_store = DEFAULT;     (0)
    PRAGMA temp_store = FILE;     (1)
    PRAGMA temp_store = MEMORY;     (2)

    Query or change the setting of the "temp_store" parameter. When temp_store is DEFAULT (0), the compile-time C preprocessor macro TEMP_STORE is used to determine where temporary tables and indices are stored. When temp_store is MEMORY (2) temporary tables and indices are kept in memory. When temp_store is FILE (1) temporary tables and indices are stored in a file. The temp_store_directory pragma can be used to specify the directory containing this file. FILE is specified. When the temp_store setting is changed, all existing temporary tables, indices, triggers, and views are immediately deleted.

    It is possible for the library compile-time C preprocessor symbol TEMP_STORE to override this pragma setting. The following table summarizes the interaction of the TEMP_STORE preprocessor macro and the temp_store pragma:

    TEMP_STORE PRAGMA
    temp_store     		Storage used for
    TEMP tables and indices
    0 | any | file
    1 | 0 | file
    1 | 1 | file
    1 | 2 | memory
    2 | 0 | memory
    2 | 1 | file
    2 | 2 | memory
    3 | any | memory

  • PRAGMA temp_store_directory;
    PRAGMA temp_store_directory = 'directory-name';

    Query or change the setting of the "temp_store_directory" - the directory where files used for storing temporary tables and indices are kept. This setting lasts for the duration of the current connection only and resets to its default value for each new connection opened.

    When the temp_store_directory setting is changed, all existing temporary tables, indices, triggers, and viewers are immediately deleted. In practice, temp_store_directory should be set immediately after the database is opened.

    The value directory-name should be enclosed in single quotes. To revert the directory to the default, set the directory-name to an empty string, e.g., PRAGMA temp_store_directory = ''. An error is raised if directory-name is not found or is not writable.

    The default directory for temporary files depends on the OS. For Unix/Linux/OSX, the default is the is the first writable directory found in the list of: /var/tmp, /usr/tmp, /tmp, and current-directory. For Windows NT, the default directory is determined by Windows, generally C:\Documents and Settings\user-name\Local Settings\Temp\. Temporary files created by SQLite are unlinked immediately after opening, so that the operating system can automatically delete the files when the SQLite process exits. Thus, temporary files are not normally visible through ls or dir commands.

Pragmas to query the database schema

  • PRAGMA database_list;

    For each open database, invoke the callback function once with information about that database. Arguments include the index and the name the database was attached with. The first row will be for the main database. The second row will be for the database used to store temporary tables.

  • PRAGMA foreign_key_list(table-name);

    For each foreign key that references a column in the argument table, invoke the callback function with information about that foreign key. The callback function will be invoked once for each column in each foreign key.

  • PRAGMA index_info(index-name);

    For each column that the named index references, invoke the callback function once with information about that column, including the column name, and the column number.

  • PRAGMA index_list(table-name);

    For each index on the named table, invoke the callback function once with information about that index. Arguments include the index name and a flag to indicate whether or not the index must be unique.

  • PRAGMA table_info(table-name);

    For each column in the named table, invoke the callback function once with information about that column, including the column name, data type, whether or not the column can be NULL, and the default value for the column.

Pragmas to query/modify version values

  • PRAGMA [database.]schema_version;
    PRAGMA [database.]schema_version =     integer ;
    PRAGMA [database.]user_version;
    PRAGMA [database.]user_version =     integer ;

    The pragmas schema_version and user_version are used to set or get the value of the schema-version and user-version, respectively. Both the schema-version and the user-version are 32-bit signed integers stored in the database header.

    The schema-version is usually only manipulated internally by SQLite. It is incremented by SQLite whenever the database schema is modified (by creating or dropping a table or index). The schema version is used by SQLite each time a query is executed to ensure that the internal cache of the schema used when compiling the SQL query matches the schema of the database against which the compiled query is actually executed. Subverting this mechanism by using "PRAGMA schema_version" to modify the schema-version is potentially dangerous and may lead to program crashes or database corruption. Use with caution!

    The user-version is not used internally by SQLite. It may be used by applications for any purpose.

Pragmas to debug the library

  • PRAGMA integrity_check;

    The command does an integrity check of the entire database. It looks for out-of-order records, missing pages, malformed records, and corrupt indices. If any problems are found, then a single string is returned which is a description of all problems. If everything is in order, "ok" is returned.

  • PRAGMA parser_trace = ON; (1)
    PRAGMA parser_trace = OFF;     (0)

    Turn tracing of the SQL parser inside of the SQLite library on and off. This is used for debugging. This only works if the library is compiled without the NDEBUG macro.

  • PRAGMA vdbe_trace = ON; (1)
    PRAGMA vdbe_trace = OFF;     (0)

    Turn tracing of the virtual database engine inside of the SQLite library on and off. This is used for debugging. See the VDBE documentation for more information.

  • PRAGMA vdbe_listing = ON; (1)
    PRAGMA vdbe_listing = OFF;     (0)

    Turn listings of virtual machine programs on and off. With listing is on, the entire content of a program is printed just prior to beginning execution. This is like automatically executing an EXPLAIN prior to each statement. The statement executes normally after the listing is printed. This is used for debugging. See the VDBE documentation for more information.


REINDEX
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

REINDEX

sql-statement ::= REINDEX collation name
sql-statement ::= REINDEX [database-name .] table/index-name

The REINDEX command is used to delete and recreate indices from scratch. This is useful when the definition of a collation sequence has changed.

In the first form, all indices in all attached databases that use the named collation sequence are recreated. In the second form, if [database-name.]table/index-name identifies a table, then all indices associated with the table are rebuilt. If an index is identified, then only this specific index is deleted and recreated.

If no database-name is specified and there exists both a table or index and a collation sequence of the specified name, then indices associated with the collation sequence only are reconstructed. This ambiguity may be dispelled by always specifying a database-name when reindexing a specific table or index.


REPLACE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

REPLACE

sql-statement ::= REPLACE INTO [database-name .] table-name [( column-list )] VALUES ( value-list ) |
REPLACE INTO [database-name .] table-name [( column-list )] select-statement

The REPLACE command is an alias for the "INSERT OR REPLACE" variant of the INSERT command. This alias is provided for compatibility with MySQL. See the INSERT command documentation for additional information.


SELECT
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

SELECT

sql-statement ::= | SELECT [ALL | DISTINCT] result [FROM table-list] [WHERE expr] [GROUP BY expr-list] [HAVING expr] [compound-op select]* [ORDER BY sort-expr-list] [LIMIT integer [( OFFSET | , ) integer]]
result ::= | result-column [, result-column]*
result-column ::= | * | table-name . * | expr [ [AS] string ]
table-list ::= | table [join-op table join-args]*
table ::= | table-name [AS alias] | ( select ) [AS alias]
join-op ::= | , | [NATURAL] [LEFT | RIGHT | FULL] [OUTER | INNER | CROSS] JOIN
join-args ::= | [ON expr] [USING ( id-list )]
sort-expr-list ::= | expr [sort-order] [, expr [sort-order]]*
sort-order ::= | [ COLLATE collation-name ] [ ASC | DESC ]
compound_op ::= | UNION | UNION ALL | INTERSECT | EXCEPT

The SELECT statement is used to query the database. The result of a SELECT is zero or more rows of data where each row has a fixed number of columns. The number of columns in the result is specified by the expression list in between the SELECT and FROM keywords. Any arbitrary expression can be used as a result. If a result expression is * then all columns of all tables are substituted for that one expression. If the expression is the name of a table followed by .* then the result is all columns in that one table.

The DISTINCT keyword causes a subset of result rows to be returned, in which each result row is different. NULL values are not treated as distinct from each other. The default behavior is that all result rows be returned, which can be made explicit with the keyword ALL.

The query is executed against one or more tables specified after the FROM keyword. If multiple tables names are separated by commas, then the query is against the cross join of the various tables. The full SQL-92 join syntax can also be used to specify joins. A sub-query in parentheses may be substituted for any table name in the FROM clause. The entire FROM clause may be omitted, in which case the result is a single row consisting of the values of the expression list.

The WHERE clause can be used to limit the number of rows over which the query operates.

The GROUP BY clauses causes one or more rows of the result to be combined into a single row of output. This is especially useful when the result contains aggregate functions. The expressions in the GROUP BY clause do not have to be expressions that appear in the result. The HAVING clause is similar to WHERE except that HAVING applies after grouping has occurred. The HAVING expression may refer to values, even aggregate functions, that are not in the result.

The ORDER BY clause causes the output rows to be sorted. The argument to ORDER BY is a list of expressions that are used as the key for the sort. The expressions do not have to be part of the result for a simple SELECT, but in a compound SELECT each sort expression must exactly match one of the result columns. Each sort expression may be optionally followed by a COLLATE keyword and the name of a collating function used for ordering text and/or keywords ASC or DESC to specify the sort order.

The LIMIT clause places an upper bound on the number of rows returned in the result. A negative LIMIT indicates no upper bound. The optional OFFSET following LIMIT specifies how many rows to skip at the beginning of the result set. In a compound query, the LIMIT clause may only appear on the final SELECT statement. The limit is applied to the entire query not to the individual SELECT statement to which it is attached. Note that if the OFFSET keyword is used in the LIMIT clause, then the limit is the first number and the offset is the second number. If a comma is used instead of the OFFSET keyword, then the offset is the first number and the limit is the second number. This seeming contradition is intentional - it maximizes compatibility with legacy SQL database systems.

A compound SELECT is formed from two or more simple SELECTs connected by one of the operators UNION, UNION ALL, INTERSECT, or EXCEPT. In a compound SELECT, all the constituent SELECTs must specify the same number of result columns. There may be only a single ORDER BY clause at the end of the compound SELECT. The UNION and UNION ALL operators combine the results of the SELECTs to the right and left into a single big table. The difference is that in UNION all result rows are distinct where in UNION ALL there may be duplicates. The INTERSECT operator takes the intersection of the results of the left and right SELECTs. EXCEPT takes the result of left SELECT after removing the results of the right SELECT. When three or more SELECTs are connected into a compound, they group from left to right.


UPDATE
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

UPDATE

sql-statement ::= | UPDATE [ OR conflict-algorithm ] [database-name .] table-name SET assignment [, assignment]* [WHERE expr]
assignment ::= | column-name = expr

The UPDATE statement is used to change the value of columns in selected rows of a table. Each assignment in an UPDATE specifies a column name to the left of the equals sign and an arbitrary expression to the right. The expressions may use the values of other columns. All expressions are evaluated before any assignments are made. A WHERE clause can be used to restrict which rows are updated.

The optional conflict-clause allows the specification of an alternative constraint conflict resolution algorithm to use during this one command. See the section titled ON CONFLICT for additional information.


TYPES

VACUUM
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite

VACUUM

sql-statement ::= VACUUM [index-or-tablename]

The VACUUM command is an SQLite extension modeled after a similar command found in PostgreSQL. If VACUUM is invoked with the name of a table or index then it is suppose to clean up the named table or index. In version 1.0 of SQLite, the VACUUM command would invoke gdbm_reorganize() to clean up the backend database file.

VACUUM became a no-op when the GDBM backend was removed from SQLITE in version 2.0.0. VACUUM was reimplemented in version 2.8.1. The index or table name argument is now ignored.

When an object (table, index, or trigger) is dropped from the database, it leaves behind empty space. This makes the database file larger than it needs to be, but can speed up inserts. In time inserts and deletes can leave the database file structure fragmented, which slows down disk access to the database contents. The VACUUM command cleans the main database by copying its contents to a temporary database file and reloading the original database file from the copy. This eliminates free pages, aligns table data to be contiguous, and otherwise cleans up the database file structure. It is not possible to perform the same process on an attached database file.

This command will fail if there is an active transaction. This command has no effect on an in-memory database.

As of SQLite version 3.1, an alternative to using the VACUUM command is auto-vacuum mode, enabled using the auto_vacuum pragma.


System.Data.SQLite

SQLite ADO.NET Provider

System.Data.SQLite Namespace

Namespace Hierarchy

Classes

Class | Description
CommitEventArgs | Event arguments raised when a transaction is being committed
ConnectionEventArgs | Event data for connection event handlers.
LogEventArgs | Event data for logging event handlers.
SQLiteCommand | SQLite implementation of DbCommand.
SQLiteCommandBuilder | SQLite implementation of DbCommandBuilder.
SQLiteConnection | SQLite implentation of DbConnection.
SQLiteConnectionStringBuilder | SQLite implementation of DbConnectionStringBuilder.
SQLiteConvert | This base class provides datatype conversion services for the SQLite provider.
SQLiteDataAdapter | SQLite implementation of DbDataAdapter.
SQLiteDataReader | SQLite implementation of DbDataReader.
SQLiteException | SQLite exception class.
SQLiteFactory | SQLite implementation of DbProviderFactory.
SQLiteFunction | This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each connection to the database.
SQLiteFunctionAttribute | A simple custom attribute to enable us to easily find user-defined functions in the loaded assemblies and initialize them in SQLite as connections are made.
SQLiteFunctionEx | Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call.
SQLiteLog | Manages the SQLite custom logging functionality and the associated callback for the whole process.
SQLiteMetaDataCollectionNames | MetaDataCollections specific to SQLite
SQLiteParameter | SQLite implementation of DbParameter.
SQLiteParameterCollection | SQLite implementation of DbParameterCollection.
SQLiteTransaction | SQLite implementation of DbTransaction.
TraceEventArgs | Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text
UpdateEventArgs | Passed during an Update callback, these event arguments detail the type of update operation being performed on the given connection.

Interfaces

Interface | Description
ISQLiteConnectionPool | This interface represents a custom connection pool implementation usable by System.Data.SQLite.

Structures

Structure | Description
CollationSequence | A struct describing the collating sequence a function is executing in

Delegates

Delegate | Description
SQLiteBackupCallback | Raised between each backup step.
SQLiteCommitHandler | Raised when a transaction is about to be committed. To roll back a transaction, set the rollbackTrans boolean value to true.
SQLiteConnectionEventHandler | Raised when an event pertaining to a connection occurs.
SQLiteLogEventHandler | Raised when a log event occurs.
SQLiteTraceEventHandler | Raised when a statement first begins executing on a given connection
SQLiteUpdateEventHandler | Raised when data is inserted, updated and deleted on a given connection

Enumerations

Enumeration | Description
CollationEncodingEnum | The encoding type the collation sequence uses
CollationTypeEnum | The type of collating sequence
FunctionType | The type of user-defined function to declare
SQLiteConnectionEventType | These are the event types associated with the SQLiteConnectionEventHandler delegate (and its corresponding event) and the ConnectionEventArgs class.
SQLiteConnectionFlags | The extra behavioral flags that can be applied to a connection.
SQLiteDateFormats | This implementation of SQLite for ADO.NET can process date/time fields in databases in only one of three formats. Ticks, ISO8601 and JulianDay.
SQLiteErrorCode | SQLite error codes. Actually, this enumeration represents a return code, which may also indicate success in one of several ways (e.g. SQLITE_OK, SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is something of a misnomer.
SQLiteExecuteType | The requested command execution type. This controls which method of the SQLiteCommand object will be called.
SQLiteJournalModeEnum | This enum determines how SQLite treats its journal file.
SynchronizationModes | The I/O file cache flushing behavior for the connection
TypeAffinity | SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite understands. The DateTime extension to the spec is for internal use only.
UpdateEventType | Whenever an update event is triggered on a connection, this enum will indicate exactly what type of operation is being performed.


CollationEncodingEnum Enumeration

The encoding type the collation sequence uses

public enum CollationEncodingEnum

Members

Member Name | Description
UTF8 | The collation sequence is UTF8
UTF16LE | The collation sequence is UTF16 little-endian
UTF16BE | The collation sequence is UTF16 big-endian

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace

Send comments on this topic.

Generated from assembly System.Data.SQLite [1.0.85.0] by NDoc3


CollationSequence Structure

A struct describing the collating sequence a function is executing in

For a list of all members of this type, see CollationSequence Members .

System.Object
CollationSequence

public struct CollationSequence

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

CollationSequence Members | System.Data.SQLite Namespace


CollationSequence Members

CollationSequence overview

Public Instance Fields

Encoding | The text encoding of the collation sequence
Name | The name of the collating sequence
Type | The type of collating sequence

Public Instance Methods

Compare | Overloaded. Calls the base collating sequence to compare two strings
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence Fields

The fields of the CollationSequence structure are listed below. For a complete list of CollationSequence structure members, see the CollationSequence Members topic.

Public Instance Fields

Encoding | The text encoding of the collation sequence
Name | The name of the collating sequence
Type | The type of collating sequence

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence.Encoding Field

The text encoding of the collation sequence

public CollationEncodingEnum Encoding;

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence.Name Field

The name of the collating sequence

public string Name;

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence.Type Field

The type of collating sequence

public CollationTypeEnum Type;

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence Methods

The methods of the CollationSequence structure are listed below. For a complete list of CollationSequence structure members, see the CollationSequence Members topic.

Public Instance Methods

Compare | Overloaded. Calls the base collating sequence to compare two strings
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CollationSequence Class | System.Data.SQLite Namespace


Compare Method

SQLite ADO.NET Provider

CollationSequence.Compare Method

Calls the base collating sequence to compare two character arrays

Overload List

Calls the base collating sequence to compare two character arrays

public int Compare(char[],char[])

Calls the base collating sequence to compare two strings

public int Compare(string,string)

See Also

CollationSequence Class | System.Data.SQLite Namespace


CollationSequence.Compare(Char, Char) Method

Calls the base collating sequence to compare two character arrays

public int Compare(
char[] c1,
char[] c2
);

Parameters

c1
The first array to compare
c2
The second array to compare

Return Value

-1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2

See Also

CollationSequence Class | System.Data.SQLite Namespace | CollationSequence.Compare Overload List


CollationSequence.Compare(String, String) Method

Calls the base collating sequence to compare two strings

public int Compare(
string s1,
string s2
);

Parameters

s1
The first string to compare
s2
The second string to compare

Return Value

-1 if s1 is less than s2, 0 if s1 is equal to s2, and 1 if s1 is greater than s2

See Also

CollationSequence Class | System.Data.SQLite Namespace | CollationSequence.Compare Overload List


CollationTypeEnum Enumeration

The type of collating sequence

public enum CollationTypeEnum

Members

Member Name | Description
Binary | The built-in BINARY collating sequence
NoCase | The built-in NOCASE collating sequence
Reverse | The built-in REVERSE collating sequence
Custom | A custom user-defined collating sequence

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


CommitEventArgs Class

Event arguments raised when a transaction is being committed

For a list of all members of this type, see CommitEventArgs Members .

System.Object
EventArgs
CommitEventArgs

public class CommitEventArgs : EventArgs

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

CommitEventArgs Members | System.Data.SQLite Namespace


CommitEventArgs Members

CommitEventArgs overview

Public Instance Fields

AbortTransaction Set to true to abort the transaction and trigger a rollback

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CommitEventArgs Class | System.Data.SQLite Namespace


CommitEventArgs Fields

The fields of the CommitEventArgs class are listed below. For a complete list of CommitEventArgs class members, see the CommitEventArgs Members topic.

Public Instance Fields

AbortTransaction Set to true to abort the transaction and trigger a rollback

See Also

CommitEventArgs Class | System.Data.SQLite Namespace


CommitEventArgs.AbortTransaction Field

Set to true to abort the transaction and trigger a rollback

public bool AbortTransaction;

See Also

CommitEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs Class

Event data for connection event handlers.

For a list of all members of this type, see ConnectionEventArgs Members .

System.Object
EventArgs
ConnectionEventArgs

public class ConnectionEventArgs : EventArgs

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

ConnectionEventArgs Members | System.Data.SQLite Namespace


ConnectionEventArgs Members

ConnectionEventArgs overview

Public Instance Fields

Command | The command associated with this event, if any.
Data | Extra data associated with this event, if any.
EventArgs | The StateChangeEventArgs associated with this event, if any.
EventType | The type of event being raised.
Text | Command or message text associated with this event, if any.
Transaction | The transaction associated with this event, if any.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs Fields

The fields of the ConnectionEventArgs class are listed below. For a complete list of ConnectionEventArgs class members, see the ConnectionEventArgs Members topic.

Public Instance Fields

Command | The command associated with this event, if any.
Data | Extra data associated with this event, if any.
EventArgs | The StateChangeEventArgs associated with this event, if any.
EventType | The type of event being raised.
Text | Command or message text associated with this event, if any.
Transaction | The transaction associated with this event, if any.

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.Command Field

The command associated with this event, if any.

public readonly IDbCommand Command;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.Data Field

Extra data associated with this event, if any.

public readonly object Data;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.EventArgs Field

The StateChangeEventArgs associated with this event, if any.

public readonly StateChangeEventArgs EventArgs;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.EventType Field

The type of event being raised.

public readonly SQLiteConnectionEventType EventType;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.Text Field

Command or message text associated with this event, if any.

public readonly string Text;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


ConnectionEventArgs.Transaction Field

The transaction associated with this event, if any.

public readonly IDbTransaction Transaction;

See Also

ConnectionEventArgs Class | System.Data.SQLite Namespace


FunctionType Enumeration

The type of user-defined function to declare

public enum FunctionType

Members

Member Name | Description
Scalar | Scalar functions are designed to be called and return a result immediately. Examples include ABS(), Upper(), Lower(), etc.
Aggregate | Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data. Examples include SUM(), COUNT(), AVG(), etc.
Collation | Collation sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause. Typically text in an ORDER BY is sorted using a straight case-insensitive comparison function. Custom collating sequences can be used to alter the behavior of text sorting in a user-defined manner.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


ISQLiteConnectionPool Interface

This interface represents a custom connection pool implementation usable by System.Data.SQLite.

For a list of all members of this type, see ISQLiteConnectionPool Members .

public interface ISQLiteConnectionPool

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

ISQLiteConnectionPool Members | System.Data.SQLite Namespace


ISQLiteConnectionPool Members

ISQLiteConnectionPool overview

Public Instance Methods

Add | Adds a connection to the pool of those associated with the specified database file name.
ClearAllPools | Disposes of all pooled connections.
ClearPool | Disposes of all pooled connections associated with the specified database file name.
GetCounts | Counts the number of pool entries matching the specified file name.
Remove | Removes a connection from the pool of those associated with the specified database file name with the intent of using it to interact with the database.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool Methods

The methods of the ISQLiteConnectionPool interface are listed below. For a complete list of ISQLiteConnectionPool interface members, see the ISQLiteConnectionPool Members topic.

Public Instance Methods

Add | Adds a connection to the pool of those associated with the specified database file name.
ClearAllPools | Disposes of all pooled connections.
ClearPool | Disposes of all pooled connections associated with the specified database file name.
GetCounts | Counts the number of pool entries matching the specified file name.
Remove | Removes a connection from the pool of those associated with the specified database file name with the intent of using it to interact with the database.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool.Add Method

Adds a connection to the pool of those associated with the specified database file name.

void Add(
string fileName,
object handle,
int version
);

Parameters

fileName
The database file name.
handle
The database connection handle.
version
The connection pool version at the point the database connection handle was received from the connection pool. This is also the connection pool version that the database connection handle was created under.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool.ClearAllPools Method

Disposes of all pooled connections.

void ClearAllPools();

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool.ClearPool Method

Disposes of all pooled connections associated with the specified database file name.

void ClearPool(
string fileName
);

Parameters

fileName
The database file name.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool.GetCounts Method

Counts the number of pool entries matching the specified file name.

void GetCounts(
string fileName,
ref Dictionary<string, int> counts,
ref int openCount,
ref int closeCount,
ref int totalCount
);

Parameters

fileName
The file name to match or null to match all files.
counts
The pool entry counts for each matching file.
openCount
The total number of connections successfully opened from any pool.
closeCount
The total number of connections successfully closed from any pool.
totalCount
The total number of pool entries for all matching files.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


ISQLiteConnectionPool.Remove Method

Removes a connection from the pool of those associated with the specified database file name with the intent of using it to interact with the database.

object Remove(
string fileName,
int maxPoolSize,
out int version
);

Parameters

fileName
The database file name.
maxPoolSize
The new maximum size of the connection pool for the specified database file name.
version
The connection pool version associated with the returned database connection handle, if any.

Return Value

The database connection handle associated with the specified database file name or null if it cannot be obtained.

See Also

ISQLiteConnectionPool Interface | System.Data.SQLite Namespace


LogEventArgs Class

Event data for logging event handlers.

For a list of all members of this type, see LogEventArgs Members .

System.Object
EventArgs
LogEventArgs

public class LogEventArgs : EventArgs

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

LogEventArgs Members | System.Data.SQLite Namespace


LogEventArgs Members

LogEventArgs overview

Public Instance Fields

Data | Extra data associated with this event, if any.
ErrorCode | The error code. The type of this object value should be Int32 or SQLiteErrorCode.
Message | SQL statement text as the statement first begins executing

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

LogEventArgs Class | System.Data.SQLite Namespace


LogEventArgs Fields

The fields of the LogEventArgs class are listed below. For a complete list of LogEventArgs class members, see the LogEventArgs Members topic.

Public Instance Fields

Data | Extra data associated with this event, if any.
ErrorCode | The error code. The type of this object value should be Int32 or SQLiteErrorCode.
Message | SQL statement text as the statement first begins executing

See Also

LogEventArgs Class | System.Data.SQLite Namespace


LogEventArgs.Data Field

Extra data associated with this event, if any.

public readonly object Data;

See Also

LogEventArgs Class | System.Data.SQLite Namespace


LogEventArgs.ErrorCode Field

The error code. The type of this object value should be Int32 or SQLiteErrorCode.

public readonly object ErrorCode;

See Also

LogEventArgs Class | System.Data.SQLite Namespace


LogEventArgs.Message Field

SQL statement text as the statement first begins executing

public readonly string Message;

See Also

LogEventArgs Class | System.Data.SQLite Namespace


SQLiteBackupCallback Delegate

Raised between each backup step.

public delegate bool SQLiteBackupCallback(
SQLiteConnection source,
string sourceName,
SQLiteConnection destination,
string destinationName,
int pages,
int remainingPages,
int totalPages,
bool retry
);

Parameters

source
The source database connection.
sourceName
The source database name.
destination
The destination database connection.
destinationName
The destination database name.
pages
The number of pages copied with each step.
remainingPages
The number of pages remaining to be copied.
totalPages
The total number of pages in the source database.
retry
Set to true if the operation needs to be retried due to database locking issues; otherwise, set to false.

Return Value

True to continue with the backup process or false to halt the backup process, rolling back any changes that have been made so far.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteCommand Class

SQLite implementation of DbCommand.

For a list of all members of this type, see SQLiteCommand Members .

System.Object
MarshalByRefObject
Component
DbCommand
SQLiteCommand

public sealed class SQLiteCommand : DbCommand, ICloneable

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteCommand Members | System.Data.SQLite Namespace


SQLiteCommand Members

SQLiteCommand overview

Public Static Methods

Execute This method creates a new connection, executes the query using the given execution type, closes the connection, and returns the results. If the connection string is null, a temporary in-memory database connection will be used.

Public Instance Constructors

SQLiteCommand Overloaded. Constructs a new SQLiteCommand

Public Instance Properties

CommandText | The SQL command text associated with the command
CommandTimeout | The amount of time to wait for the connection to become available before erroring out
CommandType | The type of the command. SQLite only supports CommandType.Text
Connection | Overloaded. The connection associated with this command
Container (inherited from Component) | Gets the IContainer that contains the Component.
DesignTimeVisible | Determines if the command is visible at design time. Defaults to True.
Parameters | Overloaded. Returns the SQLiteParameterCollection for the given command
Site (inherited from Component) | Gets or sets the ISite of the Component.
Transaction | Overloaded. The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the command's underlying connection.
UpdatedRowSource | Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable.

Public Instance Methods

Cancel | Not implemented
Clone | Clones a command, including all its parameters
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
CreateParameter | Create a new parameter
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ExecuteNonQuery | Execute the command and return the number of rows inserted/updated affected by it.
ExecuteReader | Overloaded. Overrides the default behavior to return a SQLiteDataReader specialization class
ExecuteScalar | Execute the command and return the first column of the first row of the resultset (if present), or null if no resultset was returned.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Prepare | Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Disposed (inherited from Component) Occurs when the component is disposed by a call to the Dispose method.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DbConnection | Forwards to the local Connection property
DbParameterCollection | Forwards to the local Parameters property
DbTransaction | Forwards to the local Transaction property
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

Protected Instance Methods

CreateDbParameter | Forwards to the local CreateParameter() function
Dispose | Overloaded. Disposes of the command and clears all member variables
ExecuteDbDataReader | Creates a new SQLiteDataReader to execute/iterate the array of SQLite prepared statements
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand Constructor

Constructs a new SQLiteCommand

Overload List

Default constructor

public SQLiteCommand()

Initializes the command and associates it with the specified connection.

public SQLiteCommand(SQLiteConnection)

Initializes the command with the given command text

public SQLiteCommand(string)

Initializes the command with the given SQL command text and attach the command to the specified connection.

public SQLiteCommand(string,SQLiteConnection)

Initializes a command with the given SQL, connection and transaction

public SQLiteCommand(string,SQLiteConnection,SQLiteTransaction)

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand Constructor

Default constructor

SQLiteCommand();

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand Constructor Overload List


SQLiteCommand Constructor

Initializes the command with the given command text

SQLiteCommand(
string commandText
);

Parameters

commandText
The SQL command text

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand Constructor Overload List


SQLiteCommand Constructor

Initializes the command with the given SQL command text and attach the command to the specified connection.

SQLiteCommand(
string commandText,
SQLiteConnection connection
);

Parameters

commandText
The SQL command text
connection
The connection to associate with the command

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand Constructor Overload List


SQLiteCommand Constructor

Initializes the command and associates it with the specified connection.

SQLiteCommand(
SQLiteConnection connection
);

Parameters

connection
The connection to associate with the command

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand Constructor Overload List


SQLiteCommand Constructor

Initializes a command with the given SQL, connection and transaction

SQLiteCommand(
string commandText,
SQLiteConnection connection,
SQLiteTransaction transaction
);

Parameters

commandText
The SQL command text
connection
The connection to associate with the command
transaction
The transaction the command should be associated with

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand Constructor Overload List


SQLiteCommand Properties

The properties of the SQLiteCommand class are listed below. For a complete list of SQLiteCommand class members, see the SQLiteCommand Members topic.

Public Instance Properties

CommandText | The SQL command text associated with the command
CommandTimeout | The amount of time to wait for the connection to become available before erroring out
CommandType | The type of the command. SQLite only supports CommandType.Text
Connection | Overloaded. The connection associated with this command
Container (inherited from Component) | Gets the IContainer that contains the Component.
DesignTimeVisible | Determines if the command is visible at design time. Defaults to True.
Parameters | Overloaded. Returns the SQLiteParameterCollection for the given command
Site (inherited from Component) | Gets or sets the ISite of the Component.
Transaction | Overloaded. The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the command's underlying connection.
UpdatedRowSource | Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DbConnection | Forwards to the local Connection property
DbParameterCollection | Forwards to the local Parameters property
DbTransaction | Forwards to the local Transaction property
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


CommandText Property

SQLite ADO.NET Provider

SQLiteCommand.CommandText Property

The SQL command text associated with the command

public override string CommandText { public get; public set; }

Implements

IDbCommand.CommandText

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


CommandTimeout Property

SQLite ADO.NET Provider

SQLiteCommand.CommandTimeout Property

The amount of time to wait for the connection to become available before erroring out

public override int CommandTimeout { public get; public set; }

Implements

IDbCommand.CommandTimeout

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


CommandType Property

SQLite ADO.NET Provider

SQLiteCommand.CommandType Property

The type of the command. SQLite only supports CommandType.Text

public override CommandType CommandType { public get; public set; }

Implements

IDbCommand.CommandType

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


Connection Property

SQLite ADO.NET Provider

SQLiteCommand.Connection Property

The connection associated with this command

new public SQLiteConnection Connection { public get; public set; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


DbConnection Property

SQLite ADO.NET Provider

SQLiteCommand.DbConnection Property

Forwards to the local Connection property

protected override DbConnection DbConnection { protected get; protected set; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


DbParameterCollection Property

SQLite ADO.NET Provider

SQLiteCommand.DbParameterCollection Property

Forwards to the local Parameters property

protected override DbParameterCollection DbParameterCollection { protected get; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


DbTransaction Property

SQLite ADO.NET Provider

SQLiteCommand.DbTransaction Property

Forwards to the local Transaction property

protected override DbTransaction DbTransaction { protected get; protected set; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


DesignTimeVisible Property

SQLite ADO.NET Provider

SQLiteCommand.DesignTimeVisible Property

Determines if the command is visible at design time. Defaults to True.

public override bool DesignTimeVisible { public get; public set; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


Parameters Property

SQLite ADO.NET Provider

SQLiteCommand.Parameters Property

Returns the SQLiteParameterCollection for the given command

new public SQLiteParameterCollection Parameters { public get; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


Transaction Property

SQLite ADO.NET Provider

SQLiteCommand.Transaction Property

The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the command's underlying connection.

new public SQLiteTransaction Transaction { public get; public set; }

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


UpdatedRowSource Property

SQLite ADO.NET Provider

SQLiteCommand.UpdatedRowSource Property

Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable.

public override UpdateRowSource UpdatedRowSource { public get; public set; }

Implements

IDbCommand.UpdatedRowSource

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand Methods

The methods of the SQLiteCommand class are listed below. For a complete list of SQLiteCommand class members, see the SQLiteCommand Members topic.

Public Static Methods

Execute This method creates a new connection, executes the query using the given execution type, closes the connection, and returns the results. If the connection string is null, a temporary in-memory database connection will be used.

Public Instance Methods

Cancel | Not implemented
Clone | Clones a command, including all its parameters
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
CreateParameter | Create a new parameter
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ExecuteNonQuery | Execute the command and return the number of rows inserted/updated affected by it.
ExecuteReader | Overloaded. Overrides the default behavior to return a SQLiteDataReader specialization class
ExecuteScalar | Execute the command and return the first column of the first row of the resultset (if present), or null if no resultset was returned.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Prepare | Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.

Protected Instance Methods

CreateDbParameter | Forwards to the local CreateParameter() function
Dispose | Overloaded. Disposes of the command and clears all member variables
ExecuteDbDataReader | Creates a new SQLiteDataReader to execute/iterate the array of SQLite prepared statements
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.Cancel Method

Not implemented

public override void Cancel();

Implements

IDbCommand.Cancel

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.Clone Method

Clones a command, including all its parameters

public object Clone();

Return Value

A new SQLiteCommand with the same commandtext, connection and parameters

Implements

ICloneable.Clone

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.CreateDbParameter Method

Forwards to the local CreateParameter() function

protected override DbParameter CreateDbParameter();

Return Value

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.CreateParameter Method

Create a new parameter

new public SQLiteParameter CreateParameter();

Return Value

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteCommand.Dispose Method

Disposes of the command and clears all member variables

Overload List

Inherited from Component.

public void Dispose()

Disposes of the command and clears all member variables

protected override void Dispose(bool)

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.Dispose(Boolean) Method

Disposes of the command and clears all member variables

protected override void Dispose(
bool disposing
);

Parameters

disposing
Whether or not the class is being explicitly or implicitly disposed

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand.Dispose Overload List


SQLiteCommand.Execute Method

This method creates a new connection, executes the query using the given execution type, closes the connection, and returns the results. If the connection string is null, a temporary in-memory database connection will be used.

public static object Execute(
string commandText,
SQLiteExecuteType executeType,
string connectionString,
params object[] args
);

Parameters

commandText
The text of the command to be executed.
executeType
The execution type for the command. This is used to determine which method of the command object to call, which then determines the type of results returned, if any.
connectionString
The connection string to the database to be opened, used, and closed. If this parameter is null, a temporary in-memory databse will be used.
args
The SQL parameter values to be used when building the command object to be executed, if any.

Return Value

The results of the query -OR- null if no results were produced from the given execution type.

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.ExecuteDbDataReader Method

Creates a new SQLiteDataReader to execute/iterate the array of SQLite prepared statements

protected override DbDataReader ExecuteDbDataReader(
CommandBehavior behavior
);

Parameters

behavior
The behavior the data reader should adopt

Return Value

Returns a SQLiteDataReader object

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.ExecuteNonQuery Method

Execute the command and return the number of rows inserted/updated affected by it.

public override int ExecuteNonQuery();

Return Value

Implements

IDbCommand.ExecuteNonQuery

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


ExecuteReader Method

SQLite ADO.NET Provider

SQLiteCommand.ExecuteReader Method

Overrides the default behavior of DbDataReader to return a specialized SQLiteDataReader class

Overload List

Overrides the default behavior of DbDataReader to return a specialized SQLiteDataReader class

new public SQLiteDataReader ExecuteReader()

Overrides the default behavior to return a SQLiteDataReader specialization class

new public SQLiteDataReader ExecuteReader(CommandBehavior)

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.ExecuteReader() Method

Overrides the default behavior of DbDataReader to return a specialized SQLiteDataReader class

new public SQLiteDataReader ExecuteReader();

Return Value

A SQLiteDataReader

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand.ExecuteReader Overload List


SQLiteCommand.ExecuteReader(CommandBehavior) Method

Overrides the default behavior to return a SQLiteDataReader specialization class

new public SQLiteDataReader ExecuteReader(
CommandBehavior behavior
);

Parameters

behavior
The flags to be associated with the reader

Return Value

A SQLiteDataReader

See Also

SQLiteCommand Class | System.Data.SQLite Namespace | SQLiteCommand.ExecuteReader Overload List


SQLiteCommand.ExecuteScalar Method

Execute the command and return the first column of the first row of the resultset (if present), or null if no resultset was returned.

public override object ExecuteScalar();

Return Value

The first column of the first row of the first resultset from the query

Implements

IDbCommand.ExecuteScalar

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommand.Prepare Method

Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards.

public override void Prepare();

Implements

IDbCommand.Prepare

See Also

SQLiteCommand Class | System.Data.SQLite Namespace


SQLiteCommandBuilder Class

SQLite implementation of DbCommandBuilder.

For a list of all members of this type, see SQLiteCommandBuilder Members .

System.Object
MarshalByRefObject
Component
DbCommandBuilder
SQLiteCommandBuilder

public sealed class SQLiteCommandBuilder : DbCommandBuilder

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteCommandBuilder Members | System.Data.SQLite Namespace


SQLiteCommandBuilder Members

SQLiteCommandBuilder overview

Public Instance Constructors

SQLiteCommandBuilder Overloaded. Initializes a new instance of the SQLiteCommandBuilder class.

Public Instance Properties

CatalogLocation | Overridden to hide its property from the designer
CatalogSeparator | Overridden to hide its property from the designer
ConflictOption (inherited from DbCommandBuilder) | Specifies which ConflictOption is to be used by the DbCommandBuilder.
Container (inherited from Component) | Gets the IContainer that contains the Component.
DataAdapter | Overloaded. Gets/sets the DataAdapter for this CommandBuilder
QuotePrefix | Overridden to hide its property from the designer
QuoteSuffix | Overridden to hide its property from the designer
SchemaSeparator | Overridden to hide its property from the designer
SetAllValues (inherited from DbCommandBuilder) | Specifies whether all column values in an update statement are included or only changed ones.
Site (inherited from Component) | Gets or sets the ISite of the Component.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetDeleteCommand | Overloaded. Returns the automatically-generated SQLite command to delete rows from the database
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInsertCommand | Overloaded. Returns the automatically-generated SQLite command to insert rows into the database
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
GetUpdateCommand | Overloaded. Returns the automatically-generated SQLite command to update rows in the database
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
QuoteIdentifier | Places brackets around an identifier
RefreshSchema (inherited from DbCommandBuilder) | Clears the commands associated with this DbCommandBuilder.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.
UnquoteIdentifier | Removes brackets around an identifier

Public Instance Events

Disposed (inherited from Component) Occurs when the component is disposed by a call to the Dispose method.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

Protected Instance Methods

ApplyParameterInfo | Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema
Dispose | Overloaded.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetParameterName | Overloaded. Returns a valid named parameter
GetParameterPlaceholder | Returns a placeholder character for the specified parameter i.
GetSchemaTable | Override helper, which can help the base command builder choose the right keys for the given query
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
InitializeCommand (inherited from DbCommandBuilder) | Resets the CommandTimeout, Transaction, CommandType, and UpdateRowSource properties on the DbCommand.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
RowUpdatingHandler (inherited from DbCommandBuilder) | Adds an event handler for the RowUpdating event.
SetRowUpdatingHandler | Sets the handler for receiving row updating events. Used by the DbCommandBuilder to autogenerate SQL statements that may not have previously been generated.

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder Constructor

Default constructor

Overload List

Default constructor

public SQLiteCommandBuilder()

Initializes the command builder and associates it with the specified data adapter.

public SQLiteCommandBuilder(SQLiteDataAdapter)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder Constructor

Default constructor

SQLiteCommandBuilder();

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder Constructor Overload List


SQLiteCommandBuilder Constructor

Initializes the command builder and associates it with the specified data adapter.

SQLiteCommandBuilder(
SQLiteDataAdapter adp
);

Parameters

adp

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder Constructor Overload List


SQLiteCommandBuilder Properties

The properties of the SQLiteCommandBuilder class are listed below. For a complete list of SQLiteCommandBuilder class members, see the SQLiteCommandBuilder Members topic.

Public Instance Properties

CatalogLocation | Overridden to hide its property from the designer
CatalogSeparator | Overridden to hide its property from the designer
ConflictOption (inherited from DbCommandBuilder) | Specifies which ConflictOption is to be used by the DbCommandBuilder.
Container (inherited from Component) | Gets the IContainer that contains the Component.
DataAdapter | Overloaded. Gets/sets the DataAdapter for this CommandBuilder
QuotePrefix | Overridden to hide its property from the designer
QuoteSuffix | Overridden to hide its property from the designer
SchemaSeparator | Overridden to hide its property from the designer
SetAllValues (inherited from DbCommandBuilder) | Specifies whether all column values in an update statement are included or only changed ones.
Site (inherited from Component) | Gets or sets the ISite of the Component.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


CatalogLocation Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.CatalogLocation Property

Overridden to hide its property from the designer

public override CatalogLocation CatalogLocation { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


CatalogSeparator Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.CatalogSeparator Property

Overridden to hide its property from the designer

public override string CatalogSeparator { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


DataAdapter Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.DataAdapter Property

Gets/sets the DataAdapter for this CommandBuilder

new public SQLiteDataAdapter DataAdapter { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


QuotePrefix Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.QuotePrefix Property

Overridden to hide its property from the designer

public override string QuotePrefix { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


QuoteSuffix Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.QuoteSuffix Property

Overridden to hide its property from the designer

public override string QuoteSuffix { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SchemaSeparator Property

SQLite ADO.NET Provider

SQLiteCommandBuilder.SchemaSeparator Property

Overridden to hide its property from the designer

public override string SchemaSeparator { public get; public set; }

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder Methods

The methods of the SQLiteCommandBuilder class are listed below. For a complete list of SQLiteCommandBuilder class members, see the SQLiteCommandBuilder Members topic.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetDeleteCommand | Overloaded. Returns the automatically-generated SQLite command to delete rows from the database
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInsertCommand | Overloaded. Returns the automatically-generated SQLite command to insert rows into the database
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
GetUpdateCommand | Overloaded. Returns the automatically-generated SQLite command to update rows in the database
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
QuoteIdentifier | Places brackets around an identifier
RefreshSchema (inherited from DbCommandBuilder) | Clears the commands associated with this DbCommandBuilder.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.
UnquoteIdentifier | Removes brackets around an identifier

Protected Instance Methods

ApplyParameterInfo | Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema
Dispose | Overloaded.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetParameterName | Overloaded. Returns a valid named parameter
GetParameterPlaceholder | Returns a placeholder character for the specified parameter i.
GetSchemaTable | Override helper, which can help the base command builder choose the right keys for the given query
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
InitializeCommand (inherited from DbCommandBuilder) | Resets the CommandTimeout, Transaction, CommandType, and UpdateRowSource properties on the DbCommand.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
RowUpdatingHandler (inherited from DbCommandBuilder) | Adds an event handler for the RowUpdating event.
SetRowUpdatingHandler | Sets the handler for receiving row updating events. Used by the DbCommandBuilder to autogenerate SQL statements that may not have previously been generated.

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.ApplyParameterInfo Method

Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema

protected override void ApplyParameterInfo(
DbParameter parameter,
DataRow row,
StatementType statementType,
bool whereClause
);

Parameters

parameter
The parameter to use in applying custom behaviors to a row
row
The row to apply the parameter to
statementType
The type of statement
whereClause
Whether the application of the parameter is part of a WHERE clause

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteCommandBuilder.Dispose Method

Overload List

Inherited from Component.

public void Dispose()

protected override void Dispose(bool)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.Dispose(Boolean) Method

protected override void Dispose(
bool disposing
);

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.Dispose Overload List


GetDeleteCommand Method

SQLite ADO.NET Provider

SQLiteCommandBuilder.GetDeleteCommand Method

Returns the automatically-generated SQLite command to delete rows from the database

Overload List

Returns the automatically-generated SQLite command to delete rows from the database

new public SQLiteCommand GetDeleteCommand()

Returns the automatically-generated SQLite command to delete rows from the database

new public SQLiteCommand GetDeleteCommand(bool)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.GetDeleteCommand() Method

Returns the automatically-generated SQLite command to delete rows from the database

new public SQLiteCommand GetDeleteCommand();

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetDeleteCommand Overload List


SQLiteCommandBuilder.GetDeleteCommand(Boolean) Method

Returns the automatically-generated SQLite command to delete rows from the database

new public SQLiteCommand GetDeleteCommand(
bool useColumnsForParameterNames
);

Parameters

useColumnsForParameterNames

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetDeleteCommand Overload List


GetInsertCommand Method

SQLite ADO.NET Provider

SQLiteCommandBuilder.GetInsertCommand Method

Returns the automatically-generated SQLite command to insert rows into the database

Overload List

Returns the automatically-generated SQLite command to insert rows into the database

new public SQLiteCommand GetInsertCommand()

Returns the automatically-generated SQLite command to insert rows into the database

new public SQLiteCommand GetInsertCommand(bool)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.GetInsertCommand() Method

Returns the automatically-generated SQLite command to insert rows into the database

new public SQLiteCommand GetInsertCommand();

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetInsertCommand Overload List


SQLiteCommandBuilder.GetInsertCommand(Boolean) Method

Returns the automatically-generated SQLite command to insert rows into the database

new public SQLiteCommand GetInsertCommand(
bool useColumnsForParameterNames
);

Parameters

useColumnsForParameterNames

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetInsertCommand Overload List


GetParameterName Method

SQLite ADO.NET Provider

SQLiteCommandBuilder.GetParameterName Method

Returns a named parameter for the given ordinal

Overload List

Returns a named parameter for the given ordinal

protected override string GetParameterName(int)

Returns a valid named parameter

protected override string GetParameterName(string)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.GetParameterName(Int32) Method

Returns a named parameter for the given ordinal

protected override string GetParameterName(
int parameterOrdinal
);

Parameters

parameterOrdinal
The i of the parameter

Return Value

Error

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetParameterName Overload List


SQLiteCommandBuilder.GetParameterName(String) Method

Returns a valid named parameter

protected override string GetParameterName(
string parameterName
);

Parameters

parameterName
The name of the parameter

Return Value

Error

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetParameterName Overload List


SQLiteCommandBuilder.GetParameterPlaceholder Method

Returns a placeholder character for the specified parameter i.

protected override string GetParameterPlaceholder(
int parameterOrdinal
);

Parameters

parameterOrdinal
The index of the parameter to provide a placeholder for

Return Value

Returns a named parameter

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.GetSchemaTable Method

Override helper, which can help the base command builder choose the right keys for the given query

protected override DataTable GetSchemaTable(
DbCommand sourceCommand
);

Parameters

sourceCommand

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


GetUpdateCommand Method

SQLite ADO.NET Provider

SQLiteCommandBuilder.GetUpdateCommand Method

Returns the automatically-generated SQLite command to update rows in the database

Overload List

Returns the automatically-generated SQLite command to update rows in the database

new public SQLiteCommand GetUpdateCommand()

Returns the automatically-generated SQLite command to update rows in the database

new public SQLiteCommand GetUpdateCommand(bool)

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.GetUpdateCommand() Method

Returns the automatically-generated SQLite command to update rows in the database

new public SQLiteCommand GetUpdateCommand();

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetUpdateCommand Overload List


SQLiteCommandBuilder.GetUpdateCommand(Boolean) Method

Returns the automatically-generated SQLite command to update rows in the database

new public SQLiteCommand GetUpdateCommand(
bool useColumnsForParameterNames
);

Parameters

useColumnsForParameterNames

Return Value

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace | SQLiteCommandBuilder.GetUpdateCommand Overload List


SQLiteCommandBuilder.QuoteIdentifier Method

Places brackets around an identifier

public override string QuoteIdentifier(
string unquotedIdentifier
);

Parameters

unquotedIdentifier
The identifier to quote

Return Value

The bracketed identifier

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.SetRowUpdatingHandler Method

Sets the handler for receiving row updating events. Used by the DbCommandBuilder to autogenerate SQL statements that may not have previously been generated.

protected override void SetRowUpdatingHandler(
DbDataAdapter adapter
);

Parameters

adapter
A data adapter to receive events on.

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommandBuilder.UnquoteIdentifier Method

Removes brackets around an identifier

public override string UnquoteIdentifier(
string quotedIdentifier
);

Parameters

quotedIdentifier
The quoted (bracketed) identifier

Return Value

The undecorated identifier

See Also

SQLiteCommandBuilder Class | System.Data.SQLite Namespace


SQLiteCommitHandler Delegate

Raised when a transaction is about to be committed. To roll back a transaction, set the rollbackTrans boolean value to true.

public delegate void SQLiteCommitHandler(
object sender,
CommitEventArgs e
);

Parameters

sender
The connection committing the transaction
e
Event arguments on the transaction

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteConnection Class

SQLite implentation of DbConnection.

For a list of all members of this type, see SQLiteConnection Members .

System.Object
MarshalByRefObject
Component
DbConnection
SQLiteConnection

public sealed class SQLiteConnection : DbConnection, ICloneable

Remarks

The ConnectionString property can contain the following parameter(s), delimited with a semi-colon:

Parameter | Values | Required | Default
Data Source | This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). | Y |
Version | 3 | N | 3
UseUTF16Encoding | True False | N | False
DateTimeFormat | Ticks - Use the value of DateTime.Ticks. ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values). JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC. UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970). InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. | N | ISO8601
DateTimeKind | Unspecified - Not specified as either UTC or local time. Utc - The time represented is UTC. Local - The time represented is local time. | N | Unspecified
BaseSchemaName | Some base data classes in the framework (e.g. those that build SQL queries dynamically) assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used as a placeholder and removed prior to preparing any SQL statements that may contain it. | N | sqlite_default_schema
BinaryGUID | True - Store GUID columns in binary form False - Store GUID columns as text | N | True
Cache Size | {size in bytes} | N | 2000
Synchronous | Normal - Normal file flushing behavior Full - Full flushing after all writes Off - Underlying OS flushes I/O's | N | Full
Page Size | {size in bytes} | N | 1024
Password | {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. | N |
HexPassword | {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. | N |
Enlist | Y - Automatically enlist in distributed transactions N - No automatic enlistment | N | Y
Pooling | True - Use connection pooling. False - Do not use connection pooling. WARNING: When using the default connection pool implementation, setting this property to True should be avoided by applications that make use of COM (either directly or indirectly) due to possible deadlocks that can occur during the finalization of some COM objects. | N | False
FailIfMissing | True - Don't create the database if it does not exist, throw an error instead False - Automatically create the database if it does not exist | N | False
Max Page Count | {size in pages} - Limits the maximum number of pages (limits the size) of the database | N | 0
Legacy Format | True - Use the more compatible legacy 3.x database format False - Use the newer 3.3x database format which compresses numbers more effectively | N | False
Default Timeout | {time in seconds} The default command timeout | N | 30
Journal Mode | Delete - Delete the journal file after a commit Persist - Zero out and leave the journal file on disk after a commit Off - Disable the rollback journal entirely | N | Delete
Read Only | True - Open the database for read only access False - Open the database for normal read/write access | N | False
Max Pool Size | The maximum number of connections for the given connection string that can be in the connection pool | N | 100
Default IsolationLevel | The default transaciton isolation level | N | Serializable
Foreign Keys | Enable foreign key constraints | N | False
Flags | Extra behavioral flags for the connection. See the SQLiteConnectionFlags enumeration for possible values. | N | Default
SetDefaults | True - Apply the default connection settings to the opened database. False - Skip applying the default connection settings to the opened database. | N | True
ToFullPath | True - Attempt to expand the data source file name to a fully qualified path before opening. False - Skip attempting to expand the data source file name to a fully qualified path before opening. | N | True

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteConnection Members | System.Data.SQLite Namespace


SQLiteConnection Members

SQLiteConnection overview

Public Static Properties

ConnectionPool | This property is used to obtain or set the custom connection pool implementation to use, if any. Setting this property to null will cause the default connection pool implementation to be used.
DefineConstants | Returns a string containing the define constants (i.e. compile-time options) used to compile the core managed assembly, delimited with spaces.
SQLiteSourceId | This method returns the string whose value is the same as the SQLITE_SOURCE_ID C preprocessor macro used when compiling the SQLite core library.
SQLiteVersion | Returns the version of the underlying SQLite database engine

Public Static Methods

ClearAllPools | Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed.
ClearPool | Clears the connection pool associated with the connection. Any other active connections using the same database file will be discarded instead of returned to the pool when they are closed.
CreateFile | Creates a database file. This just creates a zero-byte file which SQLite will turn into a database when the file is opened properly.
CreateHandle | Creates and returns a new managed database connection handle. This method is intended to be used by implementations of the ISQLiteConnectionPool interface only. In theory, it could be used by other classes; however, that usage is not supported.
SetMemoryStatus | Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is global to the process.

Public Static Events

Changed This event is raised when events related to the lifecycle of a SQLiteConnection object occur.

Public Instance Constructors

SQLiteConnection Overloaded. Constructs a new SQLiteConnection object

Public Instance Properties

Changes | Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on this connection.
ConnectionString | The connection string containing the parameters for the connection
ConnectionTimeout (inherited from DbConnection) | Gets the time to wait while establishing a connection before terminating the attempt and generating an error.
Container (inherited from Component) | Gets the IContainer that contains the Component.
Database | Returns the string "main".
DataSource | Returns the data source file name without extension or path.
DefaultTimeout | Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. This can also be set in the ConnectionString with "Default Timeout"
Flags | Gets/sets the extra behavioral flags for this connection. See the SQLiteConnectionFlags enumeration for a list of possible values.
LastInsertRowId | Returns the rowid of the most recent successful INSERT into the database from this connection.
MemoryHighwater | Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset.
MemoryUsed | Returns the amount of memory (in bytes) currently in use by the SQLite core library.
ParseViaFramework | Non-zero if the built-in (i.e. framework provided) connection string parser should be used when opening the connection.
PoolCount | Returns the number of pool entries for the file name associated with this connection.
ServerVersion | Returns the version of the underlying SQLite database engine
Site (inherited from Component) | Gets or sets the ISite of the Component.
State | Returns the state of the connection.

Public Instance Methods

BackupDatabase | Backs up the database, using the specified database connection as the destination.
BeginTransaction | Overloaded. OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.
Cancel | This method causes any pending database operation to abort and return at its earliest opportunity. This routine is typically called in response to a user action such as pressing "Cancel" or Ctrl-C where the user wants a long query operation to halt immediately. It is safe to call this routine from any thread. However, it is not safe to call this routine with a database connection that is closed or might close before this method returns.
ChangeDatabase | This method is not implemented; however, the Changed event will still be raised.
ChangePassword | Overloaded. Change the password (or assign a password) to an open database.
Clone | Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection will also be opened.
Close | When the database connection is closed, all commands linked to this connection are automatically reset.
CreateCommand | Create a new SQLiteCommand and associate it with this connection.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
EnableExtensions | Enables or disabled extension loading.
EnlistTransaction | Manual distributed transaction enlistment support
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ExtendedResultCode | Enables or disabled extended result codes returned by SQLite
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetSchema Overloaded. The following commands are used to extract schema information out of the database. Valid schema types are:
  • MetaDataCollections
  • DataSourceInformation
  • Catalogs
  • Columns
  • ForeignKeys
  • Indexes
  • IndexColumns
  • Tables
  • Views
  • ViewColumns
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
LoadExtension | Overloaded. Loads a SQLite extension library from the named dynamic link library file.
LogMessage | Overloaded. Add a log message via the SQLite sqlite3_log interface.
Open | Opens the connection using the parameters found in the ConnectionString.
OpenAndReturn | Opens the connection using the parameters found in the ConnectionString and then returns it.
ResultCode | Enables or disabled extended result codes returned by SQLite
SetAvRetry | Queries or modifies the number of retries or the retry interval (in milliseconds) for certain I/O operations that may fail due to anti-virus software.
SetExtendedResultCodes | Enables or disabled extended result codes returned by SQLite
SetPassword | Overloaded. Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.
Shutdown | Passes a shutdown request off to SQLite.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Commit | This event is raised whenever SQLite is committing a transaction. Return non-zero to trigger a rollback.
Disposed (inherited from Component) | Occurs when the component is disposed by a call to the Dispose method.
RollBack | This event is raised whenever SQLite is rolling back a transaction.
StateChange | This event is raised whenever the database is opened or closed.
Trace | This event is raised whenever SQLite statement first begins executing on this connection. It only applies to the given connection.
Update | This event is raised whenever SQLite makes an update/delete/insert into the database on this connection. It only applies to the given connection.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DbProviderFactory | Returns the SQLiteFactory instance.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

Protected Instance Methods

BeginDbTransaction | Forwards to the local BeginTransaction function
CreateDbCommand | Forwards to the local CreateCommand function.
Dispose | Overloaded.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
OnStateChange (inherited from DbConnection) | Raises the StateChange event.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection Constructor

Constructs a new SQLiteConnection object

Overload List

Default constructor

public SQLiteConnection()

Clones the settings and connection string from an existing connection. If the existing connection is already open, this function will open its own connection, enumerate any attached databases of the original connection, and automatically attach to them.

public SQLiteConnection(SQLiteConnection)

Initializes the connection with the specified connection string.

public SQLiteConnection(string)

Initializes the connection with the specified connection string.

public SQLiteConnection(string,bool)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection Constructor

Default constructor

SQLiteConnection();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection Constructor Overload List


SQLiteConnection Constructor

Initializes the connection with the specified connection string.

SQLiteConnection(
string connectionString
);

Parameters

connectionString
The connection string to use.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection Constructor Overload List


SQLiteConnection Constructor

Initializes the connection with the specified connection string.

SQLiteConnection(
string connectionString,
bool parseViaFramework
);

Parameters

connectionString
The connection string to use on.
parseViaFramework
Non-zero to parse the connection string using the built-in (i.e. framework provided) parser when opening the connection.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection Constructor Overload List


SQLiteConnection Constructor

Clones the settings and connection string from an existing connection. If the existing connection is already open, this function will open its own connection, enumerate any attached databases of the original connection, and automatically attach to them.

SQLiteConnection(
SQLiteConnection connection
);

Parameters

connection
The connection to copy the settings from.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection Constructor Overload List


SQLiteConnection Properties

The properties of the SQLiteConnection class are listed below. For a complete list of SQLiteConnection class members, see the SQLiteConnection Members topic.

Public Static Properties

ConnectionPool | This property is used to obtain or set the custom connection pool implementation to use, if any. Setting this property to null will cause the default connection pool implementation to be used.
DefineConstants | Returns a string containing the define constants (i.e. compile-time options) used to compile the core managed assembly, delimited with spaces.
SQLiteSourceId | This method returns the string whose value is the same as the SQLITE_SOURCE_ID C preprocessor macro used when compiling the SQLite core library.
SQLiteVersion | Returns the version of the underlying SQLite database engine

Public Instance Properties

Changes | Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on this connection.
ConnectionString | The connection string containing the parameters for the connection
ConnectionTimeout (inherited from DbConnection) | Gets the time to wait while establishing a connection before terminating the attempt and generating an error.
Container (inherited from Component) | Gets the IContainer that contains the Component.
Database | Returns the string "main".
DataSource | Returns the data source file name without extension or path.
DefaultTimeout | Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. This can also be set in the ConnectionString with "Default Timeout"
Flags | Gets/sets the extra behavioral flags for this connection. See the SQLiteConnectionFlags enumeration for a list of possible values.
LastInsertRowId | Returns the rowid of the most recent successful INSERT into the database from this connection.
MemoryHighwater | Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset.
MemoryUsed | Returns the amount of memory (in bytes) currently in use by the SQLite core library.
ParseViaFramework | Non-zero if the built-in (i.e. framework provided) connection string parser should be used when opening the connection.
PoolCount | Returns the number of pool entries for the file name associated with this connection.
ServerVersion | Returns the version of the underlying SQLite database engine
Site (inherited from Component) | Gets or sets the ISite of the Component.
State | Returns the state of the connection.

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DbProviderFactory | Returns the SQLiteFactory instance.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


Changes Property

SQLite ADO.NET Provider

SQLiteConnection.Changes Property

Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on this connection.

public int Changes { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


ConnectionPool Property

SQLite ADO.NET Provider

SQLiteConnection.ConnectionPool Property

This property is used to obtain or set the custom connection pool implementation to use, if any. Setting this property to null will cause the default connection pool implementation to be used.

public static ISQLiteConnectionPool ConnectionPool { public get; public set; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


ConnectionString Property

SQLite ADO.NET Provider

SQLiteConnection.ConnectionString Property

The connection string containing the parameters for the connection

public override string ConnectionString { public get; public set; }

Implements

IDbConnection.ConnectionString

Remarks

Parameter | Values | Required | Default
Data Source | This may be a file name, the string ":memory:", or any supported URI (starting with SQLite 3.7.7). | Y |
Version | 3 | N | 3
UseUTF16Encoding | True False | N | False
DateTimeFormat | Ticks - Use the value of DateTime.Ticks. ISO8601 - Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values). JulianDay - The interval of time in days and fractions of a day since January 1, 4713 BC. UnixEpoch - The whole number of seconds since the Unix epoch (January 1, 1970). InvariantCulture - Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. CurrentCulture - Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. | N | ISO8601
DateTimeKind | Unspecified - Not specified as either UTC or local time. Utc - The time represented is UTC. Local - The time represented is local time. | N | Unspecified
BaseSchemaName | Some base data classes in the framework (e.g. those that build SQL queries dynamically) assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used as a placeholder and removed prior to preparing any SQL statements that may contain it. | N | sqlite_default_schema
BinaryGUID | True - Store GUID columns in binary form False - Store GUID columns as text | N | True
Cache Size | {size in bytes} | N | 2000
Synchronous | Normal - Normal file flushing behavior Full - Full flushing after all writes Off - Underlying OS flushes I/O's | N | Full
Page Size | {size in bytes} | N | 1024
Password | {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. | N |
HexPassword | {hexPassword} - Must contain a sequence of zero or more hexadecimal encoded byte values without a leading "0x" prefix. Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. | N |
Enlist | Y - Automatically enlist in distributed transactions N - No automatic enlistment | N | Y
Pooling | True - Use connection pooling. False - Do not use connection pooling. WARNING: When using the default connection pool implementation, setting this property to True should be avoided by applications that make use of COM (either directly or indirectly) due to possible deadlocks that can occur during the finalization of some COM objects. | N | False
FailIfMissing | True - Don't create the database if it does not exist, throw an error instead False - Automatically create the database if it does not exist | N | False
Max Page Count | {size in pages} - Limits the maximum number of pages (limits the size) of the database | N | 0
Legacy Format | True - Use the more compatible legacy 3.x database format False - Use the newer 3.3x database format which compresses numbers more effectively | N | False
Default Timeout | {time in seconds} The default command timeout | N | 30
Journal Mode | Delete - Delete the journal file after a commit Persist - Zero out and leave the journal file on disk after a commit Off - Disable the rollback journal entirely | N | Delete
Read Only | True - Open the database for read only access False - Open the database for normal read/write access | N | False
Max Pool Size | The maximum number of connections for the given connection string that can be in the connection pool | N | 100
Default IsolationLevel | The default transaciton isolation level | N | Serializable
Foreign Keys | Enable foreign key constraints | N | False
Flags | Extra behavioral flags for the connection. See the SQLiteConnectionFlags enumeration for possible values. | N | Default
SetDefaults | True - Apply the default connection settings to the opened database. False - Skip applying the default connection settings to the opened database. | N | True
ToFullPath | True - Attempt to expand the data source file name to a fully qualified path before opening. False - Skip attempting to expand the data source file name to a fully qualified path before opening. | N | True

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


Database Property

SQLite ADO.NET Provider

SQLiteConnection.Database Property

Returns the string "main".

public override string Database { public get; }

Implements

IDbConnection.Database

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


DataSource Property

SQLite ADO.NET Provider

SQLiteConnection.DataSource Property

Returns the data source file name without extension or path.

public override string DataSource { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


DbProviderFactory Property

SQLite ADO.NET Provider

SQLiteConnection.DbProviderFactory Property

Returns the SQLiteFactory instance.

protected override DbProviderFactory DbProviderFactory { protected get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


DefaultTimeout Property

SQLite ADO.NET Provider

SQLiteConnection.DefaultTimeout Property

Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. This can also be set in the ConnectionString with "Default Timeout"

public int DefaultTimeout { public get; public set; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


DefineConstants Property

SQLite ADO.NET Provider

SQLiteConnection.DefineConstants Property

Returns a string containing the define constants (i.e. compile-time options) used to compile the core managed assembly, delimited with spaces.

public static string DefineConstants { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


Flags Property

SQLite ADO.NET Provider

SQLiteConnection.Flags Property

Gets/sets the extra behavioral flags for this connection. See the SQLiteConnectionFlags enumeration for a list of possible values.

public SQLiteConnectionFlags Flags { public get; public set; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


LastInsertRowId Property

SQLite ADO.NET Provider

SQLiteConnection.LastInsertRowId Property

Returns the rowid of the most recent successful INSERT into the database from this connection.

public long LastInsertRowId { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


MemoryHighwater Property

SQLite ADO.NET Provider

SQLiteConnection.MemoryHighwater Property

Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset.

public long MemoryHighwater { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


MemoryUsed Property

SQLite ADO.NET Provider

SQLiteConnection.MemoryUsed Property

Returns the amount of memory (in bytes) currently in use by the SQLite core library.

public long MemoryUsed { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


ParseViaFramework Property

SQLite ADO.NET Provider

SQLiteConnection.ParseViaFramework Property

Non-zero if the built-in (i.e. framework provided) connection string parser should be used when opening the connection.

public bool ParseViaFramework { public get; public set; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


PoolCount Property

SQLite ADO.NET Provider

SQLiteConnection.PoolCount Property

Returns the number of pool entries for the file name associated with this connection.

public int PoolCount { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


ServerVersion Property

SQLite ADO.NET Provider

SQLiteConnection.ServerVersion Property

Returns the version of the underlying SQLite database engine

public override string ServerVersion { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteSourceId Property

SQLite ADO.NET Provider

SQLiteConnection.SQLiteSourceId Property

This method returns the string whose value is the same as the SQLITE_SOURCE_ID C preprocessor macro used when compiling the SQLite core library.

public static string SQLiteSourceId { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteVersion Property

SQLite ADO.NET Provider

SQLiteConnection.SQLiteVersion Property

Returns the version of the underlying SQLite database engine

public static string SQLiteVersion { public get; }

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


State Property

SQLite ADO.NET Provider

SQLiteConnection.State Property

Returns the state of the connection.

public override ConnectionState State { public get; }

Implements

IDbConnection.State

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection Methods

The methods of the SQLiteConnection class are listed below. For a complete list of SQLiteConnection class members, see the SQLiteConnection Members topic.

Public Static Methods

ClearAllPools | Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed.
ClearPool | Clears the connection pool associated with the connection. Any other active connections using the same database file will be discarded instead of returned to the pool when they are closed.
CreateFile | Creates a database file. This just creates a zero-byte file which SQLite will turn into a database when the file is opened properly.
CreateHandle | Creates and returns a new managed database connection handle. This method is intended to be used by implementations of the ISQLiteConnectionPool interface only. In theory, it could be used by other classes; however, that usage is not supported.
SetMemoryStatus | Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is global to the process.

Public Instance Methods

BackupDatabase | Backs up the database, using the specified database connection as the destination.
BeginTransaction | Overloaded. OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.
Cancel | This method causes any pending database operation to abort and return at its earliest opportunity. This routine is typically called in response to a user action such as pressing "Cancel" or Ctrl-C where the user wants a long query operation to halt immediately. It is safe to call this routine from any thread. However, it is not safe to call this routine with a database connection that is closed or might close before this method returns.
ChangeDatabase | This method is not implemented; however, the Changed event will still be raised.
ChangePassword | Overloaded. Change the password (or assign a password) to an open database.
Clone | Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection will also be opened.
Close | When the database connection is closed, all commands linked to this connection are automatically reset.
CreateCommand | Create a new SQLiteCommand and associate it with this connection.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
EnableExtensions | Enables or disabled extension loading.
EnlistTransaction | Manual distributed transaction enlistment support
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ExtendedResultCode | Enables or disabled extended result codes returned by SQLite
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetSchema Overloaded. The following commands are used to extract schema information out of the database. Valid schema types are:
  • MetaDataCollections
  • DataSourceInformation
  • Catalogs
  • Columns
  • ForeignKeys
  • Indexes
  • IndexColumns
  • Tables
  • Views
  • ViewColumns
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
LoadExtension | Overloaded. Loads a SQLite extension library from the named dynamic link library file.
LogMessage | Overloaded. Add a log message via the SQLite sqlite3_log interface.
Open | Opens the connection using the parameters found in the ConnectionString.
OpenAndReturn | Opens the connection using the parameters found in the ConnectionString and then returns it.
ResultCode | Enables or disabled extended result codes returned by SQLite
SetAvRetry | Queries or modifies the number of retries or the retry interval (in milliseconds) for certain I/O operations that may fail due to anti-virus software.
SetExtendedResultCodes | Enables or disabled extended result codes returned by SQLite
SetPassword | Overloaded. Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.
Shutdown | Passes a shutdown request off to SQLite.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.

Protected Instance Methods

BeginDbTransaction | Forwards to the local BeginTransaction function
CreateDbCommand | Forwards to the local CreateCommand function.
Dispose | Overloaded.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
OnStateChange (inherited from DbConnection) | Raises the StateChange event.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.BackupDatabase Method

Backs up the database, using the specified database connection as the destination.

public void BackupDatabase(
SQLiteConnection destination,
string destinationName,
string sourceName,
int pages,
SQLiteBackupCallback callback,
int retryMilliseconds
);

Parameters

destination
The destination database connection.
destinationName
The destination database name.
sourceName
The source database name.
pages
The number of pages to copy or negative to copy all remaining pages.
callback
The method to invoke between each step of the backup process. This parameter may be null (i.e. no callbacks will be performed).
retryMilliseconds
The number of milliseconds to sleep after encountering a locking error during the backup process. A value less than zero means that no sleep should be performed.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.BeginDbTransaction Method

Forwards to the local BeginTransaction function

protected override DbTransaction BeginDbTransaction(
IsolationLevel isolationLevel
);

Parameters

isolationLevel
Supported isolation levels are Unspecified, Serializable, and ReadCommitted

Return Value

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


BeginTransaction Method

SQLite ADO.NET Provider

SQLiteConnection.BeginTransaction Method

Creates a new SQLiteTransaction if one isn't already active on the connection.

Overload List

Creates a new SQLiteTransaction if one isn't already active on the connection.

new public SQLiteTransaction BeginTransaction()

Obsolete. OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.

public SQLiteTransaction BeginTransaction(bool)

Creates a new SQLiteTransaction if one isn't already active on the connection.

new public SQLiteTransaction BeginTransaction(IsolationLevel)

Obsolete. OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.

public SQLiteTransaction BeginTransaction(IsolationLevel,bool)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.BeginTransaction() Method

Creates a new SQLiteTransaction if one isn't already active on the connection.

new public SQLiteTransaction BeginTransaction();

Return Value

Returns the new transaction object.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.BeginTransaction Overload List


SQLiteConnection.BeginTransaction(Boolean) Method

NOTE: This method is now obsolete.

Use one of the standard BeginTransaction methods, this one will be removed soon

OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.

public SQLiteTransaction BeginTransaction(
bool deferredLock
);

Parameters

deferredLock
When TRUE, SQLite defers obtaining a write lock until a write operation is requested. When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock.

Return Value

Returns a SQLiteTransaction object.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.BeginTransaction Overload List


SQLiteConnection.BeginTransaction(IsolationLevel) Method

Creates a new SQLiteTransaction if one isn't already active on the connection.

new public SQLiteTransaction BeginTransaction(
IsolationLevel isolationLevel
);

Parameters

isolationLevel
Supported isolation levels are Serializable, ReadCommitted and Unspecified.

Return Value

Returns a SQLiteTransaction object.

Remarks

Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the connection string, Serializable is used. Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads may begin a transaction. Other threads may read from the database, but not write. With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.BeginTransaction Overload List


SQLiteConnection.BeginTransaction(IsolationLevel, Boolean) Method

NOTE: This method is now obsolete.

Use one of the standard BeginTransaction methods, this one will be removed soon

OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection.

public SQLiteTransaction BeginTransaction(
IsolationLevel isolationLevel,
bool deferredLock
);

Parameters

isolationLevel
This parameter is ignored.
deferredLock
When TRUE, SQLite defers obtaining a write lock until a write operation is requested. When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock.

Return Value

Returns a SQLiteTransaction object.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.BeginTransaction Overload List


SQLiteConnection.Cancel Method

This method causes any pending database operation to abort and return at its earliest opportunity. This routine is typically called in response to a user action such as pressing "Cancel" or Ctrl-C where the user wants a long query operation to halt immediately. It is safe to call this routine from any thread. However, it is not safe to call this routine with a database connection that is closed or might close before this method returns.

public void Cancel();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.ChangeDatabase Method

This method is not implemented; however, the Changed event will still be raised.

public override void ChangeDatabase(
string databaseName
);

Parameters

databaseName

Implements

IDbConnection.ChangeDatabase

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


ChangePassword Method

SQLite ADO.NET Provider

SQLiteConnection.ChangePassword Method

Change the password (or assign a password) to an open database.

Overload List

Change the password (or assign a password) to an open database.

public void ChangePassword(byte[])

Change the password (or assign a password) to an open database.

public void ChangePassword(string)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.ChangePassword(Byte) Method

Change the password (or assign a password) to an open database.

public void ChangePassword(
byte[] newPassword
);

Parameters

newPassword
The new password to assign to the database

Remarks

No readers or writers may be active for this process. The database must already be open and if it already was password protected, the existing password must already have been supplied.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.ChangePassword Overload List


SQLiteConnection.ChangePassword(String) Method

Change the password (or assign a password) to an open database.

public void ChangePassword(
string newPassword
);

Parameters

newPassword
The new password to assign to the database

Remarks

No readers or writers may be active for this process. The database must already be open and if it already was password protected, the existing password must already have been supplied.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.ChangePassword Overload List


SQLiteConnection.ClearAllPools Method

Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed.

public static void ClearAllPools();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.ClearPool Method

Clears the connection pool associated with the connection. Any other active connections using the same database file will be discarded instead of returned to the pool when they are closed.

public static void ClearPool(
SQLiteConnection connection
);

Parameters

connection

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Clone Method

Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection will also be opened.

public object Clone();

Return Value

Implements

ICloneable.Clone

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Close Method

When the database connection is closed, all commands linked to this connection are automatically reset.

public override void Close();

Implements

IDbConnection.Close

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.CreateCommand Method

Create a new SQLiteCommand and associate it with this connection.

new public SQLiteCommand CreateCommand();

Return Value

Returns a new command object already assigned to this connection.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.CreateDbCommand Method

Forwards to the local CreateCommand function.

protected override DbCommand CreateDbCommand();

Return Value

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.CreateFile Method

Creates a database file. This just creates a zero-byte file which SQLite will turn into a database when the file is opened properly.

public static void CreateFile(
string databaseFileName
);

Parameters

databaseFileName
The file to create

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.CreateHandle Method

Creates and returns a new managed database connection handle. This method is intended to be used by implementations of the ISQLiteConnectionPool interface only. In theory, it could be used by other classes; however, that usage is not supported.

public static object CreateHandle(
IntPtr nativeHandle
);

Parameters

nativeHandle
This must be a native database connection handle returned by the SQLite core library and it must remain valid and open during the entire duration of the calling method.

Return Value

The new managed database connection handle or null if it cannot be created.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteConnection.Dispose Method

Overload List

Inherited from Component.

public void Dispose()

protected override void Dispose(bool)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Dispose(Boolean) Method

protected override void Dispose(
bool disposing
);

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.Dispose Overload List


SQLiteConnection.EnableExtensions Method

Enables or disabled extension loading.

public void EnableExtensions(
bool enable
);

Parameters

enable
True to enable loading of extensions, false to disable.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.EnlistTransaction Method

Manual distributed transaction enlistment support

public override void EnlistTransaction(
Transaction transaction
);

Parameters

transaction
The distributed transaction to enlist in

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.ExtendedResultCode Method

Enables or disabled extended result codes returned by SQLite

public SQLiteErrorCode ExtendedResultCode();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


GetSchema Method

SQLite ADO.NET Provider

SQLiteConnection.GetSchema Method

The following commands are used to extract schema information out of the database. Valid schema types are:

  • MetaDataCollections
  • DataSourceInformation
  • Catalogs
  • Columns
  • ForeignKeys
  • Indexes
  • IndexColumns
  • Tables
  • Views
  • ViewColumns

Overload List

Returns the MetaDataCollections schema

public override DataTable GetSchema()

Returns schema information of the specified collection

public override DataTable GetSchema(string)

Retrieves schema information using the specified constraint(s) for the specified collection

public override DataTable GetSchema(string,string[])

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.GetSchema() Method

Returns the MetaDataCollections schema

public override DataTable GetSchema();

Return Value

A DataTable of the MetaDataCollections schema

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.GetSchema Overload List


SQLiteConnection.GetSchema(String) Method

Returns schema information of the specified collection

public override DataTable GetSchema(
string collectionName
);

Parameters

collectionName
The schema collection to retrieve

Return Value

A DataTable of the specified collection

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.GetSchema Overload List


SQLiteConnection.GetSchema(String, String) Method

Retrieves schema information using the specified constraint(s) for the specified collection

public override DataTable GetSchema(
string collectionName,
string[] restrictionValues
);

Parameters

collectionName
The collection to retrieve
restrictionValues
The restrictions to impose

Return Value

A DataTable of the specified collection

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.GetSchema Overload List


LoadExtension Method

SQLite ADO.NET Provider

SQLiteConnection.LoadExtension Method

Loads a SQLite extension library from the named dynamic link library file.

Overload List

Loads a SQLite extension library from the named dynamic link library file.

public void LoadExtension(string)

Loads a SQLite extension library from the named dynamic link library file.

public void LoadExtension(string,string)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.LoadExtension(String) Method

Loads a SQLite extension library from the named dynamic link library file.

public void LoadExtension(
string fileName
);

Parameters

fileName
The name of the dynamic link library file containing the extension.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.LoadExtension Overload List


SQLiteConnection.LoadExtension(String, String) Method

Loads a SQLite extension library from the named dynamic link library file.

public void LoadExtension(
string fileName,
string procName
);

Parameters

fileName
The name of the dynamic link library file containing the extension.
procName
The name of the exported function used to initialize the extension. If null, the default "sqlite3_extension_init" will be used.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.LoadExtension Overload List


LogMessage Method

SQLite ADO.NET Provider

SQLiteConnection.LogMessage Method

Add a log message via the SQLite sqlite3_log interface.

Overload List

Add a log message via the SQLite sqlite3_log interface.

public void LogMessage(SQLiteErrorCode,string)

Add a log message via the SQLite sqlite3_log interface.

public void LogMessage(int,string)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.LogMessage(SQLiteErrorCode, String) Method

Add a log message via the SQLite sqlite3_log interface.

public void LogMessage(
SQLiteErrorCode iErrCode,
string zMessage
);

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.LogMessage Overload List


SQLiteConnection.LogMessage(Int32, String) Method

Add a log message via the SQLite sqlite3_log interface.

public void LogMessage(
int iErrCode,
string zMessage
);

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.LogMessage Overload List


SQLiteConnection.Open Method

Opens the connection using the parameters found in the ConnectionString.

public override void Open();

Implements

IDbConnection.Open

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.OpenAndReturn Method

Opens the connection using the parameters found in the ConnectionString and then returns it.

public SQLiteConnection OpenAndReturn();

Return Value

The current connection object.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.ResultCode Method

Enables or disabled extended result codes returned by SQLite

public SQLiteErrorCode ResultCode();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.SetAvRetry Method

Queries or modifies the number of retries or the retry interval (in milliseconds) for certain I/O operations that may fail due to anti-virus software.

public SQLiteErrorCode SetAvRetry(
ref int count,
ref int interval
);

Parameters

count
The number of times to retry the I/O operation. A negative value will cause the current count to be queried and replace that negative value.
interval
The number of milliseconds to wait before retrying the I/O operation. This number is multiplied by the number of retry attempts so far to come up with the final number of milliseconds to wait. A negative value will cause the current interval to be queried and replace that negative value.

Return Value

Zero for success, non-zero for error.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.SetExtendedResultCodes Method

Enables or disabled extended result codes returned by SQLite

public void SetExtendedResultCodes(
bool bOnOff
);

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.SetMemoryStatus Method

Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is global to the process.

public static SQLiteErrorCode SetMemoryStatus(
bool value
);

Parameters

value
Non-zero to enable memory usage tracking, zero otherwise.

Return Value

A standard SQLite return code (i.e. zero for success and non-zero for failure).

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SetPassword Method

SQLite ADO.NET Provider

SQLiteConnection.SetPassword Method

Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.

Overload List

Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.

public void SetPassword(byte[])

Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.

public void SetPassword(string)

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.SetPassword(Byte) Method

Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.

public void SetPassword(
byte[] databasePassword
);

Parameters

databasePassword
The password for the database

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.SetPassword Overload List


SQLiteConnection.SetPassword(String) Method

Sets the password for a password-protected database. A password-protected database is unusable for any operation until the password has been set.

public void SetPassword(
string databasePassword
);

Parameters

databasePassword
The password for the database

See Also

SQLiteConnection Class | System.Data.SQLite Namespace | SQLiteConnection.SetPassword Overload List


SQLiteConnection.Shutdown Method

Passes a shutdown request off to SQLite.

public SQLiteErrorCode Shutdown();

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection Events

The events of the SQLiteConnection class are listed below. For a complete list of SQLiteConnection class members, see the SQLiteConnection Members topic.

Public Static Events

Changed This event is raised when events related to the lifecycle of a SQLiteConnection object occur.

Public Instance Events

Commit | This event is raised whenever SQLite is committing a transaction. Return non-zero to trigger a rollback.
Disposed (inherited from Component) | Occurs when the component is disposed by a call to the Dispose method.
RollBack | This event is raised whenever SQLite is rolling back a transaction.
StateChange | This event is raised whenever the database is opened or closed.
Trace | This event is raised whenever SQLite statement first begins executing on this connection. It only applies to the given connection.
Update | This event is raised whenever SQLite makes an update/delete/insert into the database on this connection. It only applies to the given connection.

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Changed Event

This event is raised when events related to the lifecycle of a SQLiteConnection object occur.

public static event SQLiteConnectionEventHandler Changed;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Commit Event

This event is raised whenever SQLite is committing a transaction. Return non-zero to trigger a rollback.

public event SQLiteCommitHandler Commit;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.RollBack Event

This event is raised whenever SQLite is rolling back a transaction.

public event EventHandler RollBack;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.StateChange Event

This event is raised whenever the database is opened or closed.

public event StateChangeEventHandler StateChange;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Trace Event

This event is raised whenever SQLite statement first begins executing on this connection. It only applies to the given connection.

public event SQLiteTraceEventHandler Trace;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnection.Update Event

This event is raised whenever SQLite makes an update/delete/insert into the database on this connection. It only applies to the given connection.

public event SQLiteUpdateEventHandler Update;

See Also

SQLiteConnection Class | System.Data.SQLite Namespace


SQLiteConnectionEventHandler Delegate

Raised when an event pertaining to a connection occurs.

public delegate void SQLiteConnectionEventHandler(
object sender,
ConnectionEventArgs e
);

Parameters

sender
The connection involved.
e
Extra information about the event.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteConnectionEventType Enumeration

These are the event types associated with the SQLiteConnectionEventHandler delegate (and its corresponding event) and the ConnectionEventArgs class.

public enum SQLiteConnectionEventType

Members

Member Name | Description
Invalid | Not used.
Unknown | Not used.
Opening | The connection is being opened.
ConnectionString | The connection string has been parsed.
Opened | The connection was opened.
ChangeDatabase | The ChangeDatabase method was called on the connection.
NewTransaction | A transaction was created using the connection.
EnlistTransaction | The connection was enlisted into a transaction.
NewCommand | A command was created using the connection.
Closing | The connection is being closed.
Closed | The connection was closed.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteConnectionFlags Enumeration

The extra behavioral flags that can be applied to a connection.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

public enum SQLiteConnectionFlags

Members

Member Name | Description | Value
None | No extra flags. | 0
LogPrepare | Enable logging of all SQL statements to be prepared. | 1
LogPreBind | Enable logging of all bound parameter types and raw values. | 2
LogBind | Enable logging of all bound parameter strongly typed values. | 4
LogCallbackException | Enable logging of all exceptions caught from user-provided managed code called from native code via delegates. | 8
LogBackup | Enable logging of backup API errors. | 16
NoExtensionFunctions | Skip adding the extension functions provided by the native interop assembly. | 32
BindUInt32AsInt64 | When binding parameter values with the UInt32 type, use the interop method that accepts an Int64 value. | 64
BindAllAsText | When binding parameter values, always bind them as though they were plain text (i.e. no numeric, date/time, or other conversions should be attempted). | 128
GetAllAsText | When returning column values, always return them as though they were plain text (i.e. no numeric, date/time, or other conversions should be attempted). | 256
BindAndGetAllAsText | When binding and returning column values, always treat them as though they were plain text (i.e. no numeric, date/time, or other conversions should be attempted). | 384
LogAll | Enable all logging. | 31
Default | The default extra flags for new connections. | 8

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteConnectionStringBuilder Class

SQLite implementation of DbConnectionStringBuilder.

For a list of all members of this type, see SQLiteConnectionStringBuilder Members .

System.Object
DbConnectionStringBuilder
SQLiteConnectionStringBuilder

public sealed class SQLiteConnectionStringBuilder : DbConnectionStringBuilder

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteConnectionStringBuilder Members | System.Data.SQLite Namespace


SQLiteConnectionStringBuilder Members

SQLiteConnectionStringBuilder overview

Public Instance Constructors

SQLiteConnectionStringBuilder Overloaded. Constructs a new instance of the class

Public Instance Properties

BaseSchemaName | Gets/Sets the placeholder base schema name used for .NET Framework compatibility purposes.
BinaryGUID | Gets/Sets whethor not to store GUID's in binary format. The default is True which saves space in the database.
BrowsableConnectionString (inherited from DbConnectionStringBuilder) | Gets or sets a value that indicates whether the ConnectionString property is visible in Visual Studio designers.
CacheSize | Gets/Sets the cache size for the connection.
ConnectionString (inherited from DbConnectionStringBuilder) | Gets or sets the connection string associated with the DbConnectionStringBuilder.
Count (inherited from DbConnectionStringBuilder) | Gets the current number of keys that are contained within the ConnectionString property.
DataSource | Gets/Sets the filename to open on the connection string.
DateTimeFormat | Gets/Sets the DateTime format for the connection.
DateTimeKind | Gets/Sets the DateTime kind for the connection.
DefaultIsolationLevel | Sets the default isolation level for transactions on the connection.
DefaultTimeout | Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible.
Enlist | Determines whether or not the connection will automatically participate in the current distributed transaction (if one exists)
FailIfMissing | If set to true, will throw an exception if the database specified in the connection string does not exist. If false, the database will be created automatically.
Flags | Gets/Sets the extra behavioral flags.
ForeignKeys | If enabled, use foreign key constraints
FullUri | An alternate to the data source property that uses the SQLite URI syntax.
HexPassword | Gets/sets the database encryption hexadecimal password
IsFixedSize (inherited from DbConnectionStringBuilder) | Gets a value that indicates whether the DbConnectionStringBuilder has a fixed size.
IsReadOnly (inherited from DbConnectionStringBuilder) | Gets a value that indicates whether the DbConnectionStringBuilder is read-only.
Item (inherited from DbConnectionStringBuilder) | Gets or sets the value associated with the specified key.
JournalMode | Determines how SQLite handles the transaction journal file.
Keys (inherited from DbConnectionStringBuilder) | Gets an ICollection that contains the keys in the DbConnectionStringBuilder.
LegacyFormat | If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger database sizes.
MaxPageCount | Gets/Sets the maximum number of pages the database may hold
PageSize | Gets/Sets the page size for the connection.
Password | Gets/sets the database encryption password
Pooling | Gets/Sets whether or not to use connection pooling. The default is "False"
ReadOnly | When enabled, the database will be opened for read-only access and writing will be disabled.
SetDefaults | If enabled, apply the default connection settings to opened databases.
SyncMode | Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal".
ToFullPath | If enabled, attempt to resolve the provided data source file name to a full path before opening.
Uri | An alternate to the data source property
UseUTF16Encoding | Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding.
Values (inherited from DbConnectionStringBuilder) | Gets an ICollection that contains the values in the DbConnectionStringBuilder.
Version | Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library.

Public Instance Methods

Add (inherited from DbConnectionStringBuilder) | Adds an entry with the specified key and value into the DbConnectionStringBuilder.
Clear (inherited from DbConnectionStringBuilder) | Clears the contents of the DbConnectionStringBuilder instance.
ContainsKey (inherited from DbConnectionStringBuilder) | Determines whether the DbConnectionStringBuilder contains a specific key.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
EquivalentTo (inherited from DbConnectionStringBuilder) | Compares the connection information in this DbConnectionStringBuilder object with the connection information in the supplied object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove (inherited from DbConnectionStringBuilder) | Removes the entry with the specified key from the DbConnectionStringBuilder instance.
ShouldSerialize (inherited from DbConnectionStringBuilder) | Indicates whether the specified key exists in this DbConnectionStringBuilder instance.
ToString (inherited from DbConnectionStringBuilder) | Returns the connection string associated with this DbConnectionStringBuilder.
TryGetValue | Helper function for retrieving values from the connectionstring

Protected Instance Methods

ClearPropertyDescriptors (inherited from DbConnectionStringBuilder) | Clears the collection of PropertyDescriptor objects on the associated DbConnectionStringBuilder.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetProperties (inherited from DbConnectionStringBuilder) | Fills a supplied Hashtable with information about all the properties of this DbConnectionStringBuilder.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SQLiteConnectionStringBuilder Constructor

Constructs a new instance of the class

Overload List

Default constructor

public SQLiteConnectionStringBuilder()

Constructs a new instance of the class using the specified connection string.

public SQLiteConnectionStringBuilder(string)

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SQLiteConnectionStringBuilder Constructor

Default constructor

SQLiteConnectionStringBuilder();

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace | SQLiteConnectionStringBuilder Constructor Overload List


SQLiteConnectionStringBuilder Constructor

Constructs a new instance of the class using the specified connection string.

SQLiteConnectionStringBuilder(
string connectionString
);

Parameters

connectionString
The connection string to parse

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace | SQLiteConnectionStringBuilder Constructor Overload List


SQLiteConnectionStringBuilder Properties

The properties of the SQLiteConnectionStringBuilder class are listed below. For a complete list of SQLiteConnectionStringBuilder class members, see the SQLiteConnectionStringBuilder Members topic.

Public Instance Properties

BaseSchemaName | Gets/Sets the placeholder base schema name used for .NET Framework compatibility purposes.
BinaryGUID | Gets/Sets whethor not to store GUID's in binary format. The default is True which saves space in the database.
BrowsableConnectionString (inherited from DbConnectionStringBuilder) | Gets or sets a value that indicates whether the ConnectionString property is visible in Visual Studio designers.
CacheSize | Gets/Sets the cache size for the connection.
ConnectionString (inherited from DbConnectionStringBuilder) | Gets or sets the connection string associated with the DbConnectionStringBuilder.
Count (inherited from DbConnectionStringBuilder) | Gets the current number of keys that are contained within the ConnectionString property.
DataSource | Gets/Sets the filename to open on the connection string.
DateTimeFormat | Gets/Sets the DateTime format for the connection.
DateTimeKind | Gets/Sets the DateTime kind for the connection.
DefaultIsolationLevel | Sets the default isolation level for transactions on the connection.
DefaultTimeout | Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible.
Enlist | Determines whether or not the connection will automatically participate in the current distributed transaction (if one exists)
FailIfMissing | If set to true, will throw an exception if the database specified in the connection string does not exist. If false, the database will be created automatically.
Flags | Gets/Sets the extra behavioral flags.
ForeignKeys | If enabled, use foreign key constraints
FullUri | An alternate to the data source property that uses the SQLite URI syntax.
HexPassword | Gets/sets the database encryption hexadecimal password
IsFixedSize (inherited from DbConnectionStringBuilder) | Gets a value that indicates whether the DbConnectionStringBuilder has a fixed size.
IsReadOnly (inherited from DbConnectionStringBuilder) | Gets a value that indicates whether the DbConnectionStringBuilder is read-only.
Item (inherited from DbConnectionStringBuilder) | Gets or sets the value associated with the specified key.
JournalMode | Determines how SQLite handles the transaction journal file.
Keys (inherited from DbConnectionStringBuilder) | Gets an ICollection that contains the keys in the DbConnectionStringBuilder.
LegacyFormat | If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger database sizes.
MaxPageCount | Gets/Sets the maximum number of pages the database may hold
PageSize | Gets/Sets the page size for the connection.
Password | Gets/sets the database encryption password
Pooling | Gets/Sets whether or not to use connection pooling. The default is "False"
ReadOnly | When enabled, the database will be opened for read-only access and writing will be disabled.
SetDefaults | If enabled, apply the default connection settings to opened databases.
SyncMode | Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal".
ToFullPath | If enabled, attempt to resolve the provided data source file name to a full path before opening.
Uri | An alternate to the data source property
UseUTF16Encoding | Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding.
Values (inherited from DbConnectionStringBuilder) | Gets an ICollection that contains the values in the DbConnectionStringBuilder.
Version | Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library.

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


BaseSchemaName Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.BaseSchemaName Property

Gets/Sets the placeholder base schema name used for .NET Framework compatibility purposes.

public string BaseSchemaName { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


BinaryGUID Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.BinaryGUID Property

Gets/Sets whethor not to store GUID's in binary format. The default is True which saves space in the database.

public bool BinaryGUID { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


CacheSize Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.CacheSize Property

Gets/Sets the cache size for the connection.

public int CacheSize { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


DataSource Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.DataSource Property

Gets/Sets the filename to open on the connection string.

public string DataSource { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


DateTimeFormat Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.DateTimeFormat Property

Gets/Sets the DateTime format for the connection.

public SQLiteDateFormats DateTimeFormat { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


DateTimeKind Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.DateTimeKind Property

Gets/Sets the DateTime kind for the connection.

public DateTimeKind DateTimeKind { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


DefaultIsolationLevel Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.DefaultIsolationLevel Property

Sets the default isolation level for transactions on the connection.

public IsolationLevel DefaultIsolationLevel { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


DefaultTimeout Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.DefaultTimeout Property

Gets/sets the default command timeout for newly-created commands. This is especially useful for commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible.

public int DefaultTimeout { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Enlist Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Enlist Property

Determines whether or not the connection will automatically participate in the current distributed transaction (if one exists)

public bool Enlist { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


FailIfMissing Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.FailIfMissing Property

If set to true, will throw an exception if the database specified in the connection string does not exist. If false, the database will be created automatically.

public bool FailIfMissing { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Flags Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Flags Property

Gets/Sets the extra behavioral flags.

public SQLiteConnectionFlags Flags { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


ForeignKeys Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.ForeignKeys Property

If enabled, use foreign key constraints

public bool ForeignKeys { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


FullUri Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.FullUri Property

An alternate to the data source property that uses the SQLite URI syntax.

public string FullUri { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


HexPassword Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.HexPassword Property

Gets/sets the database encryption hexadecimal password

public byte[] HexPassword { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


JournalMode Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.JournalMode Property

Determines how SQLite handles the transaction journal file.

public SQLiteJournalModeEnum JournalMode { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


LegacyFormat Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.LegacyFormat Property

If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger database sizes.

public bool LegacyFormat { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


MaxPageCount Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.MaxPageCount Property

Gets/Sets the maximum number of pages the database may hold

public int MaxPageCount { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


PageSize Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.PageSize Property

Gets/Sets the page size for the connection.

public int PageSize { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Password Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Password Property

Gets/sets the database encryption password

public string Password { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Pooling Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Pooling Property

Gets/Sets whether or not to use connection pooling. The default is "False"

public bool Pooling { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


ReadOnly Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.ReadOnly Property

When enabled, the database will be opened for read-only access and writing will be disabled.

public bool ReadOnly { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SetDefaults Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.SetDefaults Property

If enabled, apply the default connection settings to opened databases.

public bool SetDefaults { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SyncMode Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.SyncMode Property

Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal".

public SynchronizationModes SyncMode { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


ToFullPath Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.ToFullPath Property

If enabled, attempt to resolve the provided data source file name to a full path before opening.

public bool ToFullPath { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Uri Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Uri Property

An alternate to the data source property

public string Uri { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


UseUTF16Encoding Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.UseUTF16Encoding Property

Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding.

public bool UseUTF16Encoding { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


Version Property

SQLite ADO.NET Provider

SQLiteConnectionStringBuilder.Version Property

Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library.

public int Version { public get; public set; }

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SQLiteConnectionStringBuilder Methods

The methods of the SQLiteConnectionStringBuilder class are listed below. For a complete list of SQLiteConnectionStringBuilder class members, see the SQLiteConnectionStringBuilder Members topic.

Public Instance Methods

Add (inherited from DbConnectionStringBuilder) | Adds an entry with the specified key and value into the DbConnectionStringBuilder.
Clear (inherited from DbConnectionStringBuilder) | Clears the contents of the DbConnectionStringBuilder instance.
ContainsKey (inherited from DbConnectionStringBuilder) | Determines whether the DbConnectionStringBuilder contains a specific key.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
EquivalentTo (inherited from DbConnectionStringBuilder) | Compares the connection information in this DbConnectionStringBuilder object with the connection information in the supplied object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove (inherited from DbConnectionStringBuilder) | Removes the entry with the specified key from the DbConnectionStringBuilder instance.
ShouldSerialize (inherited from DbConnectionStringBuilder) | Indicates whether the specified key exists in this DbConnectionStringBuilder instance.
ToString (inherited from DbConnectionStringBuilder) | Returns the connection string associated with this DbConnectionStringBuilder.
TryGetValue | Helper function for retrieving values from the connectionstring

Protected Instance Methods

ClearPropertyDescriptors (inherited from DbConnectionStringBuilder) | Clears the collection of PropertyDescriptor objects on the associated DbConnectionStringBuilder.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetProperties (inherited from DbConnectionStringBuilder) | Fills a supplied Hashtable with information about all the properties of this DbConnectionStringBuilder.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SQLiteConnectionStringBuilder.TryGetValue Method

Helper function for retrieving values from the connectionstring

public override bool TryGetValue(
string keyword,
out object value
);

Parameters

keyword
The keyword to retrieve settings for
value
The resulting parameter value

Return Value

Returns true if the value was found and returned

See Also

SQLiteConnectionStringBuilder Class | System.Data.SQLite Namespace


SQLiteConvert Class

This base class provides datatype conversion services for the SQLite provider.

For a list of all members of this type, see SQLiteConvert Members .

System.Object
SQLiteConvert

public abstract class SQLiteConvert

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteConvert Members | System.Data.SQLite Namespace


SQLiteConvert Members

SQLiteConvert overview

Public Static Methods

Split | Smart method of splitting a string. Skips quoted elements, removes the quotes.
ToBoolean | Overloaded. Convert a value to true or false.
ToDateTime | Overloaded. Converts a string into a DateTime, using the specified DateTimeFormat and DateTimeKind.
ToJulianDay | Converts a DateTime struct to a JulianDay double
ToUnixEpoch | Converts a DateTime struct to the whole number of seconds since the Unix epoch.
ToUTF8 | Overloaded. Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character.
UTF8ToString | Converts a UTF-8 encoded IntPtr of the specified length into a .NET string

Protected Static Fields

UnixEpoch The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC).

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToDateTime | Overloaded. Converts a string into a DateTime, using the current DateTimeFormat specified for the connection when it was opened.
ToString | Overloaded. Converts a UTF-8 encoded IntPtr of the specified length into a .NET string
ToString (inherited from Object) | Overloaded. Returns a String that represents the current Object.
ToUTF8 | Overloaded. Convert a DateTime to a UTF-8 encoded, zero-terminated byte array.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert Fields

The fields of the SQLiteConvert class are listed below. For a complete list of SQLiteConvert class members, see the SQLiteConvert Members topic.

Protected Static Fields

UnixEpoch The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC).

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.UnixEpoch Field

The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC).

protected static readonly DateTime UnixEpoch;

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert Methods

The methods of the SQLiteConvert class are listed below. For a complete list of SQLiteConvert class members, see the SQLiteConvert Members topic.

Public Static Methods

Split | Smart method of splitting a string. Skips quoted elements, removes the quotes.
ToBoolean | Overloaded. Convert a value to true or false.
ToDateTime | Overloaded. Converts a string into a DateTime, using the specified DateTimeFormat and DateTimeKind.
ToJulianDay | Converts a DateTime struct to a JulianDay double
ToUnixEpoch | Converts a DateTime struct to the whole number of seconds since the Unix epoch.
ToUTF8 | Overloaded. Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character.
UTF8ToString | Converts a UTF-8 encoded IntPtr of the specified length into a .NET string

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToDateTime | Overloaded. Converts a string into a DateTime, using the current DateTimeFormat specified for the connection when it was opened.
ToString | Overloaded. Converts a UTF-8 encoded IntPtr of the specified length into a .NET string
ToString (inherited from Object) | Overloaded. Returns a String that represents the current Object.
ToUTF8 | Overloaded. Convert a DateTime to a UTF-8 encoded, zero-terminated byte array.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.Split Method

Smart method of splitting a string. Skips quoted elements, removes the quotes.

public static string[] Split(
string source,
char separator
);

Parameters

source
Source string to split apart
separator
Separator character

Return Value

A string array of the split up elements

Remarks

This split function works somewhat like the String.Split() function in that it breaks apart a string into pieces and returns the pieces as an array. The primary differences are:

  • Only one character can be provided as a separator character
  • Quoted text inside the string is skipped over when searching for the separator, and the quotes are removed.
Thus, if splitting the following string looking for a comma:
One,Two, "Three, Four", Five

The resulting array would contain
[0] One
[1] Two
[2] Three, Four
[3] Five

Note that the leading and trailing spaces were removed from each item during the split.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


ToBoolean Method

SQLite ADO.NET Provider

SQLiteConvert.ToBoolean Method

Convert a value to true or false.

Overload List

Convert a value to true or false.

public static bool ToBoolean(object)

Convert a string to true or false.

public static bool ToBoolean(string)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.ToBoolean(Object) Method

Convert a value to true or false.

public static bool ToBoolean(
object source
);

Parameters

source
A string or number representing true or false

Return Value

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToBoolean Overload List


SQLiteConvert.ToBoolean(String) Method

Convert a string to true or false.

public static bool ToBoolean(
string source
);

Parameters

source
A string representing true or false

Return Value

Remarks

"yes", "no", "y", "n", "0", "1", "on", "off" as well as Boolean.FalseString and Boolean.TrueString will all be converted to a proper boolean value.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToBoolean Overload List


ToDateTime Method

SQLite ADO.NET Provider

SQLiteConvert.ToDateTime Method

Converts a julianday value into a DateTime

Overload List

Converts a julianday value into a DateTime

public DateTime ToDateTime(double)

Converts a julianday value into a DateTime

public static DateTime ToDateTime(double,DateTimeKind)

Converts a string into a DateTime, using the current DateTimeFormat specified for the connection when it was opened.

public DateTime ToDateTime(string)

Converts a string into a DateTime, using the specified DateTimeFormat and DateTimeKind.

public static DateTime ToDateTime(string,SQLiteDateFormats,DateTimeKind)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.ToDateTime(Double) Method

Converts a julianday value into a DateTime

public DateTime ToDateTime(
double julianDay
);

Parameters

julianDay
The value to convert

Return Value

A .NET DateTime

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToDateTime Overload List


SQLiteConvert.ToDateTime(Double, DateTimeKind) Method

Converts a julianday value into a DateTime

public static DateTime ToDateTime(
double julianDay,
DateTimeKind kind
);

Parameters

julianDay
The value to convert
kind
The DateTimeKind to use.

Return Value

A .NET DateTime

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToDateTime Overload List


SQLiteConvert.ToDateTime(String) Method

Converts a string into a DateTime, using the current DateTimeFormat specified for the connection when it was opened.

public DateTime ToDateTime(
string dateText
);

Parameters

dateText
The string containing either a long integer number of 100-nanosecond units since System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time string, a formatted date and time string in the current culture, or an ISO8601-format string.

Return Value

A DateTime value

Remarks

Acceptable ISO8601 DateTime formats are:

  • THHmmssK
  • THHmmK
  • HH:mm:ss.FFFFFFFK
  • HH:mm:ssK
  • HH:mmK
  • yyyy-MM-dd HH:mm:ss.FFFFFFFK
  • yyyy-MM-dd HH:mm:ssK
  • yyyy-MM-dd HH:mmK
  • yyyy-MM-ddTHH:mm:ss.FFFFFFFK
  • yyyy-MM-ddTHH:mmK
  • yyyy-MM-ddTHH:mm:ssK
  • yyyyMMddHHmmssK
  • yyyyMMddHHmmK
  • yyyyMMddTHHmmssFFFFFFFK
  • THHmmss
  • THHmm
  • HH:mm:ss.FFFFFFF
  • HH:mm:ss
  • HH:mm
  • yyyy-MM-dd HH:mm:ss.FFFFFFF
  • yyyy-MM-dd HH:mm:ss
  • yyyy-MM-dd HH:mm
  • yyyy-MM-ddTHH:mm:ss.FFFFFFF
  • yyyy-MM-ddTHH:mm
  • yyyy-MM-ddTHH:mm:ss
  • yyyyMMddHHmmss
  • yyyyMMddHHmm
  • yyyyMMddTHHmmssFFFFFFF
  • yyyy-MM-dd
  • yyyyMMdd
  • yy-MM-dd
If the string cannot be matched to one of the above formats, an exception will be thrown.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToDateTime Overload List


SQLiteConvert.ToDateTime(String, SQLiteDateFormats, DateTimeKind) Method

Converts a string into a DateTime, using the specified DateTimeFormat and DateTimeKind.

public static DateTime ToDateTime(
string dateText,
SQLiteDateFormats format,
DateTimeKind kind
);

Parameters

dateText
The string containing either a long integer number of 100-nanosecond units since System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time string, a formatted date and time string in the current culture, or an ISO8601-format string.
format
The SQLiteDateFormats to use.
kind
The DateTimeKind to use.

Return Value

A DateTime value

Remarks

Acceptable ISO8601 DateTime formats are:

  • THHmmssK
  • THHmmK
  • HH:mm:ss.FFFFFFFK
  • HH:mm:ssK
  • HH:mmK
  • yyyy-MM-dd HH:mm:ss.FFFFFFFK
  • yyyy-MM-dd HH:mm:ssK
  • yyyy-MM-dd HH:mmK
  • yyyy-MM-ddTHH:mm:ss.FFFFFFFK
  • yyyy-MM-ddTHH:mmK
  • yyyy-MM-ddTHH:mm:ssK
  • yyyyMMddHHmmssK
  • yyyyMMddHHmmK
  • yyyyMMddTHHmmssFFFFFFFK
  • THHmmss
  • THHmm
  • HH:mm:ss.FFFFFFF
  • HH:mm:ss
  • HH:mm
  • yyyy-MM-dd HH:mm:ss.FFFFFFF
  • yyyy-MM-dd HH:mm:ss
  • yyyy-MM-dd HH:mm
  • yyyy-MM-ddTHH:mm:ss.FFFFFFF
  • yyyy-MM-ddTHH:mm
  • yyyy-MM-ddTHH:mm:ss
  • yyyyMMddHHmmss
  • yyyyMMddHHmm
  • yyyyMMddTHHmmssFFFFFFF
  • yyyy-MM-dd
  • yyyyMMdd
  • yy-MM-dd
If the string cannot be matched to one of the above formats, an exception will be thrown.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToDateTime Overload List


SQLiteConvert.ToJulianDay Method

Converts a DateTime struct to a JulianDay double

public static double ToJulianDay(
DateTime value
);

Parameters

value
The DateTime to convert

Return Value

The JulianDay value the Datetime represents

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


ToString Method

SQLite ADO.NET Provider

SQLiteConvert.ToString Method

Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened.

Overload List

Inherited from Object.

public virtual string ToString()

Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened.

public string ToString(DateTime)

Converts a UTF-8 encoded IntPtr of the specified length into a .NET string

public virtual string ToString(IntPtr,int)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.ToString(DateTime) Method

Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened.

public string ToString(
DateTime dateValue
);

Parameters

dateValue
The DateTime value to convert

Return Value

Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time string, a formatted date and time string in the current culture, or an ISO8601-format date/time string.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToString Overload List


SQLiteConvert.ToString(IntPtr, Int32) Method

Converts a UTF-8 encoded IntPtr of the specified length into a .NET string

public virtual string ToString(
IntPtr nativestring,
int nativestringlen
);

Parameters

nativestring
The pointer to the memory where the UTF-8 string is encoded
nativestringlen
The number of bytes to decode

Return Value

A string containing the translated character(s)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToString Overload List


SQLiteConvert.ToUnixEpoch Method

Converts a DateTime struct to the whole number of seconds since the Unix epoch.

public static long ToUnixEpoch(
DateTime value
);

Parameters

value
The DateTime to convert

Return Value

The whole number of seconds since the Unix epoch

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


ToUTF8 Method

SQLite ADO.NET Provider

SQLiteConvert.ToUTF8 Method

Convert a DateTime to a UTF-8 encoded, zero-terminated byte array.

Overload List

Convert a DateTime to a UTF-8 encoded, zero-terminated byte array.

public byte[] ToUTF8(DateTime)

Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character.

public static byte[] ToUTF8(string)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteConvert.ToUTF8(DateTime) Method

Convert a DateTime to a UTF-8 encoded, zero-terminated byte array.

public byte[] ToUTF8(
DateTime dateTimeValue
);

Parameters

dateTimeValue
The DateTime to convert.

Return Value

The UTF-8 encoded string, including a 0 terminating byte at the end of the array.

Remarks

This function is a convenience function, which first calls ToString() on the DateTime, and then calls ToUTF8() with the string result.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToUTF8 Overload List


SQLiteConvert.ToUTF8(String) Method

Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character.

public static byte[] ToUTF8(
string sourceText
);

Parameters

sourceText
The string to convert to UTF-8

Return Value

A byte array containing the converted string plus an extra 0 terminating byte at the end of the array.

See Also

SQLiteConvert Class | System.Data.SQLite Namespace | SQLiteConvert.ToUTF8 Overload List


SQLiteConvert.UTF8ToString Method

Converts a UTF-8 encoded IntPtr of the specified length into a .NET string

public static string UTF8ToString(
IntPtr nativestring,
int nativestringlen
);

Parameters

nativestring
The pointer to the memory where the UTF-8 string is encoded
nativestringlen
The number of bytes to decode

Return Value

A string containing the translated character(s)

See Also

SQLiteConvert Class | System.Data.SQLite Namespace


SQLiteDataAdapter Class

SQLite implementation of DbDataAdapter.

For a list of all members of this type, see SQLiteDataAdapter Members .

System.Object
MarshalByRefObject
Component
DataAdapter
DbDataAdapter
SQLiteDataAdapter

public sealed class SQLiteDataAdapter : DbDataAdapter

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteDataAdapter Members | System.Data.SQLite Namespace


SQLiteDataAdapter Members

SQLiteDataAdapter overview

Public Instance Constructors

SQLiteDataAdapter Overloaded. This class is just a shell around the DbDataAdapter. Nothing from DbDataAdapter is overridden here, just a few constructors are defined.

Public Instance Properties

AcceptChangesDuringFill (inherited from DataAdapter) | Gets or sets a value indicating whether AcceptChanges is called on a DataRow after it is added to the DataTable during any of the Fill operations.
AcceptChangesDuringUpdate (inherited from DataAdapter) | Gets or sets whether AcceptChanges is called during a Update.
Container (inherited from Component) | Gets the IContainer that contains the Component.
ContinueUpdateOnError (inherited from DataAdapter) | Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.
DeleteCommand | Overloaded. Gets/sets the delete command for this DataAdapter
FillLoadOption (inherited from DataAdapter) | Gets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader.
InsertCommand | Overloaded. Gets/sets the insert command for this DataAdapter
MissingMappingAction (inherited from DataAdapter) | Determines the action to take when incoming data does not have a matching table or column.
MissingSchemaAction (inherited from DataAdapter) | Determines the action to take when existing DataSet schema does not match incoming data.
ReturnProviderSpecificTypes (inherited from DataAdapter) | Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.
SelectCommand | Overloaded. Gets/sets the select command for this DataAdapter
Site (inherited from Component) | Gets or sets the ISite of the Component.
TableMappings (inherited from DataAdapter) | Gets a collection that provides the master mapping between a source table and a DataTable.
UpdateBatchSize (inherited from DbDataAdapter) | Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.
UpdateCommand | Overloaded. Gets/sets the update command for this DataAdapter

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fill (inherited from DbDataAdapter) | Overloaded. Adds or refreshes rows in the DataSet to match those in the data source using the DataSet and DataTable names.
FillSchema (inherited from DbDataAdapter) | Overloaded. Configures the schema of the specified DataTable based on the specified SchemaType.
GetFillParameters (inherited from DbDataAdapter) | Gets the parameters set by the user when executing an SQL SELECT statement.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ResetFillLoadOption (inherited from DataAdapter) | Resets FillLoadOption to its default state and causes Fill to honor AcceptChangesDuringFill.
ShouldSerializeAcceptChangesDuringFill (inherited from DataAdapter) | Determines whether the AcceptChangesDuringFill property should be persisted.
ShouldSerializeFillLoadOption (inherited from DataAdapter) | Determines whether the FillLoadOption property should be persisted.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.
Update (inherited from DbDataAdapter) | Overloaded. Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet.

Public Instance Events

Disposed (inherited from Component) | Occurs when the component is disposed by a call to the Dispose method.
FillError (inherited from DataAdapter) | Returned when an error occurs during a fill operation.
RowUpdated | Row updated event handler
RowUpdating | Row updating event handler

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.
FillCommandBehavior (inherited from DbDataAdapter) | Gets or sets the behavior of the command used to fill the data adapter.

Protected Instance Methods

AddToBatch (inherited from DbDataAdapter) | Adds a IDbCommand to the current batch.
ClearBatch (inherited from DbDataAdapter) | Removes all IDbCommand objects from the batch.
CloneInternals (inherited from DataAdapter) | Obsolete. Creates a copy of this instance of DataAdapter.
CreateRowUpdatedEvent (inherited from DbDataAdapter) | Initializes a new instance of the RowUpdatedEventArgs class.
CreateRowUpdatingEvent (inherited from DbDataAdapter) | Initializes a new instance of the RowUpdatingEventArgs class.
CreateTableMappings (inherited from DataAdapter) | Creates a new DataTableMappingCollection.
Dispose | Overloaded.
ExecuteBatch (inherited from DbDataAdapter) | Executes the current batch.
Fill (inherited from DbDataAdapter) | Overloaded. Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable, IDbCommand and CommandBehavior.
Fill (inherited from DataAdapter) | Overloaded. Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.
FillSchema (inherited from DbDataAdapter) | Overloaded. Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.
FillSchema (inherited from DataAdapter) | Overloaded. Adds a DataTable to the specified DataSet.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetBatchedParameter (inherited from DbDataAdapter) | Returns a IDataParameter from one of the commands in the current batch.
GetBatchedRecordsAffected (inherited from DbDataAdapter) | Returns information about an individual update attempt within a larger batched update.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
HasTableMappings (inherited from DataAdapter) | Indicates whether a DataTableMappingCollection has been created.
InitializeBatching (inherited from DbDataAdapter) | Initializes batching for the DbDataAdapter.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
OnFillError (inherited from DataAdapter) | Invoked when an error occurs during a Fill.
OnRowUpdated | Raised by DbDataAdapter after a row is updated
OnRowUpdating | Raised by the underlying DbDataAdapter when a row is being updated
ShouldSerializeTableMappings (inherited from DataAdapter) | Determines whether one or more DataTableMapping objects exist and they should be persisted.
TerminateBatching (inherited from DbDataAdapter) | Ends batching for the DbDataAdapter.
Update (inherited from DbDataAdapter) | Overloaded. Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array of DataRow objects.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter Constructor

This class is just a shell around the DbDataAdapter. Nothing from DbDataAdapter is overridden here, just a few constructors are defined.

Overload List

Default constructor.

public SQLiteDataAdapter()

Constructs a data adapter using the specified select command.

public SQLiteDataAdapter(SQLiteCommand)

Constructs a data adapter with the supplied select command text and associated with the specified connection.

public SQLiteDataAdapter(string,SQLiteConnection)

Constructs a data adapter with the specified select command text, and using the specified database connection string.

public SQLiteDataAdapter(string,string)

Constructs a data adapter with the specified select command text, and using the specified database connection string.

public SQLiteDataAdapter(string,string,bool)

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter Constructor

Default constructor.

SQLiteDataAdapter();

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter Constructor Overload List


SQLiteDataAdapter Constructor

Constructs a data adapter using the specified select command.

SQLiteDataAdapter(
SQLiteCommand cmd
);

Parameters

cmd
The select command to associate with the adapter.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter Constructor Overload List


SQLiteDataAdapter Constructor

Constructs a data adapter with the supplied select command text and associated with the specified connection.

SQLiteDataAdapter(
string commandText,
SQLiteConnection connection
);

Parameters

commandText
The select command text to associate with the data adapter.
connection
The connection to associate with the select command.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter Constructor Overload List


SQLiteDataAdapter Constructor

Constructs a data adapter with the specified select command text, and using the specified database connection string.

SQLiteDataAdapter(
string commandText,
string connectionString
);

Parameters

commandText
The select command text to use to construct a select command.
connectionString
A connection string suitable for passing to a new SQLiteConnection, which is associated with the select command.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter Constructor Overload List


SQLiteDataAdapter Constructor

Constructs a data adapter with the specified select command text, and using the specified database connection string.

SQLiteDataAdapter(
string commandText,
string connectionString,
bool parseViaFramework
);

Parameters

commandText
The select command text to use to construct a select command.
connectionString
A connection string suitable for passing to a new SQLiteConnection, which is associated with the select command.
parseViaFramework
Non-zero to parse the connection string using the built-in (i.e. framework provided) parser when opening the connection.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter Constructor Overload List


SQLiteDataAdapter Properties

The properties of the SQLiteDataAdapter class are listed below. For a complete list of SQLiteDataAdapter class members, see the SQLiteDataAdapter Members topic.

Public Instance Properties

AcceptChangesDuringFill (inherited from DataAdapter) | Gets or sets a value indicating whether AcceptChanges is called on a DataRow after it is added to the DataTable during any of the Fill operations.
AcceptChangesDuringUpdate (inherited from DataAdapter) | Gets or sets whether AcceptChanges is called during a Update.
Container (inherited from Component) | Gets the IContainer that contains the Component.
ContinueUpdateOnError (inherited from DataAdapter) | Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.
DeleteCommand | Overloaded. Gets/sets the delete command for this DataAdapter
FillLoadOption (inherited from DataAdapter) | Gets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader.
InsertCommand | Overloaded. Gets/sets the insert command for this DataAdapter
MissingMappingAction (inherited from DataAdapter) | Determines the action to take when incoming data does not have a matching table or column.
MissingSchemaAction (inherited from DataAdapter) | Determines the action to take when existing DataSet schema does not match incoming data.
ReturnProviderSpecificTypes (inherited from DataAdapter) | Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.
SelectCommand | Overloaded. Gets/sets the select command for this DataAdapter
Site (inherited from Component) | Gets or sets the ISite of the Component.
TableMappings (inherited from DataAdapter) | Gets a collection that provides the master mapping between a source table and a DataTable.
UpdateBatchSize (inherited from DbDataAdapter) | Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.
UpdateCommand | Overloaded. Gets/sets the update command for this DataAdapter

Protected Instance Properties

CanRaiseEvents (inherited from Component) | Gets a value indicating whether the component can raise an event.
DesignMode (inherited from Component) | Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component) | Gets the list of event handlers that are attached to this Component.
FillCommandBehavior (inherited from DbDataAdapter) | Gets or sets the behavior of the command used to fill the data adapter.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


DeleteCommand Property

SQLite ADO.NET Provider

SQLiteDataAdapter.DeleteCommand Property

Gets/sets the delete command for this DataAdapter

new public SQLiteCommand DeleteCommand { public get; public set; }

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


InsertCommand Property

SQLite ADO.NET Provider

SQLiteDataAdapter.InsertCommand Property

Gets/sets the insert command for this DataAdapter

new public SQLiteCommand InsertCommand { public get; public set; }

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SelectCommand Property

SQLite ADO.NET Provider

SQLiteDataAdapter.SelectCommand Property

Gets/sets the select command for this DataAdapter

new public SQLiteCommand SelectCommand { public get; public set; }

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


UpdateCommand Property

SQLite ADO.NET Provider

SQLiteDataAdapter.UpdateCommand Property

Gets/sets the update command for this DataAdapter

new public SQLiteCommand UpdateCommand { public get; public set; }

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter Methods

The methods of the SQLiteDataAdapter class are listed below. For a complete list of SQLiteDataAdapter class members, see the SQLiteDataAdapter Members topic.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component) | Overloaded. Releases all resources used by the Component.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fill (inherited from DbDataAdapter) | Overloaded. Adds or refreshes rows in the DataSet to match those in the data source using the DataSet and DataTable names.
FillSchema (inherited from DbDataAdapter) | Overloaded. Configures the schema of the specified DataTable based on the specified SchemaType.
GetFillParameters (inherited from DbDataAdapter) | Gets the parameters set by the user when executing an SQL SELECT statement.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ResetFillLoadOption (inherited from DataAdapter) | Resets FillLoadOption to its default state and causes Fill to honor AcceptChangesDuringFill.
ShouldSerializeAcceptChangesDuringFill (inherited from DataAdapter) | Determines whether the AcceptChangesDuringFill property should be persisted.
ShouldSerializeFillLoadOption (inherited from DataAdapter) | Determines whether the FillLoadOption property should be persisted.
ToString (inherited from Component) | Returns a String containing the name of the Component, if any. This method should not be overridden.
Update (inherited from DbDataAdapter) | Overloaded. Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet.

Protected Instance Methods

AddToBatch (inherited from DbDataAdapter) | Adds a IDbCommand to the current batch.
ClearBatch (inherited from DbDataAdapter) | Removes all IDbCommand objects from the batch.
CloneInternals (inherited from DataAdapter) | Obsolete. Creates a copy of this instance of DataAdapter.
CreateRowUpdatedEvent (inherited from DbDataAdapter) | Initializes a new instance of the RowUpdatedEventArgs class.
CreateRowUpdatingEvent (inherited from DbDataAdapter) | Initializes a new instance of the RowUpdatingEventArgs class.
CreateTableMappings (inherited from DataAdapter) | Creates a new DataTableMappingCollection.
Dispose | Overloaded.
ExecuteBatch (inherited from DbDataAdapter) | Executes the current batch.
Fill (inherited from DbDataAdapter) | Overloaded. Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable, IDbCommand and CommandBehavior.
Fill (inherited from DataAdapter) | Overloaded. Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.
FillSchema (inherited from DbDataAdapter) | Overloaded. Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.
FillSchema (inherited from DataAdapter) | Overloaded. Adds a DataTable to the specified DataSet.
Finalize (inherited from Component) | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
GetBatchedParameter (inherited from DbDataAdapter) | Returns a IDataParameter from one of the commands in the current batch.
GetBatchedRecordsAffected (inherited from DbDataAdapter) | Returns information about an individual update attempt within a larger batched update.
GetService (inherited from Component) | Returns an object that represents a service provided by the Component or by its Container.
HasTableMappings (inherited from DataAdapter) | Indicates whether a DataTableMappingCollection has been created.
InitializeBatching (inherited from DbDataAdapter) | Initializes batching for the DbDataAdapter.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
OnFillError (inherited from DataAdapter) | Invoked when an error occurs during a Fill.
OnRowUpdated | Raised by DbDataAdapter after a row is updated
OnRowUpdating | Raised by the underlying DbDataAdapter when a row is being updated
ShouldSerializeTableMappings (inherited from DataAdapter) | Determines whether one or more DataTableMapping objects exist and they should be persisted.
TerminateBatching (inherited from DbDataAdapter) | Ends batching for the DbDataAdapter.
Update (inherited from DbDataAdapter) | Overloaded. Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array of DataRow objects.

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteDataAdapter.Dispose Method

Overload List

Inherited from Component.

public void Dispose()

protected override void Dispose(bool)

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter.Dispose(Boolean) Method

protected override void Dispose(
bool disposing
);

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace | SQLiteDataAdapter.Dispose Overload List


SQLiteDataAdapter.OnRowUpdated Method

Raised by DbDataAdapter after a row is updated

protected override void OnRowUpdated(
RowUpdatedEventArgs value
);

Parameters

value
The event's specifics

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter.OnRowUpdating Method

Raised by the underlying DbDataAdapter when a row is being updated

protected override void OnRowUpdating(
RowUpdatingEventArgs value
);

Parameters

value
The event's specifics

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter Events

The events of the SQLiteDataAdapter class are listed below. For a complete list of SQLiteDataAdapter class members, see the SQLiteDataAdapter Members topic.

Public Instance Events

Disposed (inherited from Component) | Occurs when the component is disposed by a call to the Dispose method.
FillError (inherited from DataAdapter) | Returned when an error occurs during a fill operation.
RowUpdated | Row updated event handler
RowUpdating | Row updating event handler

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter.RowUpdated Event

Row updated event handler

public event EventHandler<RowUpdatedEventArgs> RowUpdated;

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataAdapter.RowUpdating Event

Row updating event handler

public event EventHandler<RowUpdatingEventArgs> RowUpdating;

See Also

SQLiteDataAdapter Class | System.Data.SQLite Namespace


SQLiteDataReader Class

SQLite implementation of DbDataReader.

For a list of all members of this type, see SQLiteDataReader Members .

System.Object
MarshalByRefObject
DbDataReader
SQLiteDataReader

public sealed class SQLiteDataReader : DbDataReader

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteDataReader Members | System.Data.SQLite Namespace


SQLiteDataReader Members

SQLiteDataReader overview

Public Instance Properties

Depth | Not implemented. Returns 0
FieldCount | Returns the number of columns in the current resultset
HasRows | Returns True if the resultset has rows that can be fetched
IsClosed | Returns True if the data reader is closed
Item | Overloaded. Indexer to retrieve data from a column given its name
RecordsAffected | Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed!
VisibleFieldCount | Returns the number of visible fields in the current resultset

Public Instance Methods

Close | Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from DbDataReader) | Overloaded. Releases all resources used by the current instance of the DbDataReader class.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBoolean | Retrieves the column as a boolean value
GetByte | Retrieves the column as a single byte value
GetBytes | Retrieves a column as an array of bytes (blob)
GetChar | Returns the column as a single character
GetChars | Retrieves a column as an array of chars (blob)
GetData (inherited from DbDataReader) | Returns a DbDataReader object for the requested column ordinal.
GetDataTypeName | Retrieves the name of the back-end datatype of the column
GetDateTime | Retrieve the column as a date/time value
GetDecimal | Retrieve the column as a decimal value
GetDouble | Returns the column as a double
GetEnumerator | Enumerator support
GetFieldType | Returns the .NET type of a given column
GetFloat | Returns a column as a float value
GetGuid | Returns the column as a Guid
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInt16 | Returns the column as a short
GetInt32 | Retrieves the column as an int
GetInt64 | Retrieves the column as a long
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetName | Retrieves the name of the column
GetOrdinal | Retrieves the i of a column, given its name
GetProviderSpecificFieldType (inherited from DbDataReader) | Returns the provider-specific field type of the specified column.
GetProviderSpecificValue (inherited from DbDataReader) | Gets the value of the specified column as an instance of Object.
GetProviderSpecificValues (inherited from DbDataReader) | Gets all provider-specific attribute columns in the collection for the current row.
GetSchemaTable | Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done to gather the necessary information so it can be represented in an ADO.NET manner.
GetString | Retrieves the column as a string
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Retrieves the column as an object corresponding to the underlying datatype of the column
GetValues | Overloaded. Retreives the values of multiple columns, up to the size of the supplied array
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
IsDBNull | Returns True if the specified column is null
NextResult | Moves to the next resultset in multiple row-returning SQL command.
Read | Reads the next row from the resultset
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded. Dispose of all resources used by this datareader.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetDbDataReader (inherited from DbDataReader) | Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader Properties

The properties of the SQLiteDataReader class are listed below. For a complete list of SQLiteDataReader class members, see the SQLiteDataReader Members topic.

Public Instance Properties

Depth | Not implemented. Returns 0
FieldCount | Returns the number of columns in the current resultset
HasRows | Returns True if the resultset has rows that can be fetched
IsClosed | Returns True if the data reader is closed
Item | Overloaded. Indexer to retrieve data from a column given its name
RecordsAffected | Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed!
VisibleFieldCount | Returns the number of visible fields in the current resultset

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


Depth Property

SQLite ADO.NET Provider

SQLiteDataReader.Depth Property

Not implemented. Returns 0

public override int Depth { public get; }

Implements

IDataReader.Depth

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


FieldCount Property

SQLite ADO.NET Provider

SQLiteDataReader.FieldCount Property

Returns the number of columns in the current resultset

public override int FieldCount { public get; }

Implements

IDataRecord.FieldCount

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


HasRows Property

SQLite ADO.NET Provider

SQLiteDataReader.HasRows Property

Returns True if the resultset has rows that can be fetched

public override bool HasRows { public get; }

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


IsClosed Property

SQLite ADO.NET Provider

SQLiteDataReader.IsClosed Property

Returns True if the data reader is closed

public override bool IsClosed { public get; }

Implements

IDataReader.IsClosed

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


Object Property

SQLite ADO.NET Provider

SQLiteDataReader.Object Property

Indexer to retrieve data from a column given its i

Overload List

Indexer to retrieve data from a column given its i

public override object this[ int] { public get; }

Indexer to retrieve data from a column given its name

public override object this[ string] { public get; }

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


Item Property

SQLite ADO.NET Provider

SQLiteDataReader.Item Property

Indexer to retrieve data from a column given its i

public override object this[
int i
] { public get; }

Parameters

i
The index of the column to retrieve

Implements

IDataRecord.Item

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace | SQLiteDataReader.Item Overload List


Item Property

SQLite ADO.NET Provider

SQLiteDataReader.Item Property

Indexer to retrieve data from a column given its name

public override object this[
string name
] { public get; }

Parameters

name
The name of the column to retrieve data for

Implements

IDataRecord.Item

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace | SQLiteDataReader.Item Overload List


RecordsAffected Property

SQLite ADO.NET Provider

SQLiteDataReader.RecordsAffected Property

Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed!

public override int RecordsAffected { public get; }

Implements

IDataReader.RecordsAffected

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


VisibleFieldCount Property

SQLite ADO.NET Provider

SQLiteDataReader.VisibleFieldCount Property

Returns the number of visible fields in the current resultset

public override int VisibleFieldCount { public get; }

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader Methods

The methods of the SQLiteDataReader class are listed below. For a complete list of SQLiteDataReader class members, see the SQLiteDataReader Members topic.

Public Instance Methods

Close | Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from DbDataReader) | Overloaded. Releases all resources used by the current instance of the DbDataReader class.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBoolean | Retrieves the column as a boolean value
GetByte | Retrieves the column as a single byte value
GetBytes | Retrieves a column as an array of bytes (blob)
GetChar | Returns the column as a single character
GetChars | Retrieves a column as an array of chars (blob)
GetData (inherited from DbDataReader) | Returns a DbDataReader object for the requested column ordinal.
GetDataTypeName | Retrieves the name of the back-end datatype of the column
GetDateTime | Retrieve the column as a date/time value
GetDecimal | Retrieve the column as a decimal value
GetDouble | Returns the column as a double
GetEnumerator | Enumerator support
GetFieldType | Returns the .NET type of a given column
GetFloat | Returns a column as a float value
GetGuid | Returns the column as a Guid
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInt16 | Returns the column as a short
GetInt32 | Retrieves the column as an int
GetInt64 | Retrieves the column as a long
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetName | Retrieves the name of the column
GetOrdinal | Retrieves the i of a column, given its name
GetProviderSpecificFieldType (inherited from DbDataReader) | Returns the provider-specific field type of the specified column.
GetProviderSpecificValue (inherited from DbDataReader) | Gets the value of the specified column as an instance of Object.
GetProviderSpecificValues (inherited from DbDataReader) | Gets all provider-specific attribute columns in the collection for the current row.
GetSchemaTable | Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done to gather the necessary information so it can be represented in an ADO.NET manner.
GetString | Retrieves the column as a string
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Retrieves the column as an object corresponding to the underlying datatype of the column
GetValues | Overloaded. Retreives the values of multiple columns, up to the size of the supplied array
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
IsDBNull | Returns True if the specified column is null
NextResult | Moves to the next resultset in multiple row-returning SQL command.
Read | Reads the next row from the resultset
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded. Dispose of all resources used by this datareader.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetDbDataReader (inherited from DbDataReader) | Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.Close Method

Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.

public override void Close();

Implements

IDataReader.Close

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteDataReader.Dispose Method

Dispose of all resources used by this datareader.

Overload List

Inherited from DbDataReader.

public void Dispose()

Dispose of all resources used by this datareader.

protected override void Dispose(bool)

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.Dispose(Boolean) Method

Dispose of all resources used by this datareader.

protected override void Dispose(
bool disposing
);

Parameters

disposing

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace | SQLiteDataReader.Dispose Overload List


SQLiteDataReader.GetBoolean Method

Retrieves the column as a boolean value

public override bool GetBoolean(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

bool

Implements

IDataRecord.GetBoolean

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetByte Method

Retrieves the column as a single byte value

public override byte GetByte(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

byte

Implements

IDataRecord.GetByte

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetBytes Method

Retrieves a column as an array of bytes (blob)

public override long GetBytes(
int i,
long fieldOffset,
byte[] buffer,
int bufferoffset,
int length
);

Parameters

i
The index of the column to retrieve
fieldOffset
The zero-based index of where to begin reading the data
buffer
The buffer to write the bytes into
bufferoffset
The zero-based index of where to begin writing into the array
length
The number of bytes to retrieve

Return Value

The actual number of bytes written into the array

Implements

IDataRecord.GetBytes

Remarks

To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned.

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetChar Method

Returns the column as a single character

public override char GetChar(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

char

Implements

IDataRecord.GetChar

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetChars Method

Retrieves a column as an array of chars (blob)

public override long GetChars(
int i,
long fieldoffset,
char[] buffer,
int bufferoffset,
int length
);

Parameters

i
The index of the column to retrieve
fieldoffset
The zero-based index of where to begin reading the data
buffer
The buffer to write the characters into
bufferoffset
The zero-based index of where to begin writing into the array
length
The number of bytes to retrieve

Return Value

The actual number of characters written into the array

Implements

IDataRecord.GetChars

Remarks

To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned.

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetDataTypeName Method

Retrieves the name of the back-end datatype of the column

public override string GetDataTypeName(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

string

Implements

IDataRecord.GetDataTypeName

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetDateTime Method

Retrieve the column as a date/time value

public override DateTime GetDateTime(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

DateTime

Implements

IDataRecord.GetDateTime

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetDecimal Method

Retrieve the column as a decimal value

public override decimal GetDecimal(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

decimal

Implements

IDataRecord.GetDecimal

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetDouble Method

Returns the column as a double

public override double GetDouble(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

double

Implements

IDataRecord.GetDouble

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetEnumerator Method

Enumerator support

public override IEnumerator GetEnumerator();

Return Value

Returns a DbEnumerator object.

Implements

IEnumerable.GetEnumerator

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetFieldType Method

Returns the .NET type of a given column

public override Type GetFieldType(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

Type

Implements

IDataRecord.GetFieldType

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetFloat Method

Returns a column as a float value

public override float GetFloat(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

float

Implements

IDataRecord.GetFloat

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetGuid Method

Returns the column as a Guid

public override Guid GetGuid(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

Guid

Implements

IDataRecord.GetGuid

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetInt16 Method

Returns the column as a short

public override short GetInt16(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

Int16

Implements

IDataRecord.GetInt16

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetInt32 Method

Retrieves the column as an int

public override int GetInt32(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

Int32

Implements

IDataRecord.GetInt32

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetInt64 Method

Retrieves the column as a long

public override long GetInt64(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

Int64

Implements

IDataRecord.GetInt64

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetName Method

Retrieves the name of the column

public override string GetName(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

string

Implements

IDataRecord.GetName

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetOrdinal Method

Retrieves the i of a column, given its name

public override int GetOrdinal(
string name
);

Parameters

name
The name of the column to retrieve

Return Value

The int i of the column

Implements

IDataRecord.GetOrdinal

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetSchemaTable Method

Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done to gather the necessary information so it can be represented in an ADO.NET manner.

public override DataTable GetSchemaTable();

Return Value

Returns a DataTable containing the schema information for the active SELECT statement being processed.

Implements

IDataReader.GetSchemaTable

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetString Method

Retrieves the column as a string

public override string GetString(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

string

Implements

IDataRecord.GetString

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetValue Method

Retrieves the column as an object corresponding to the underlying datatype of the column

public override object GetValue(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

object

Implements

IDataRecord.GetValue

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


GetValues Method

SQLite ADO.NET Provider

SQLiteDataReader.GetValues Method

Returns a collection containing all the column names and values for the current row of data in the current resultset, if any. If there is no current row or no current resultset, an exception may be thrown.

Overload List

Returns a collection containing all the column names and values for the current row of data in the current resultset, if any. If there is no current row or no current resultset, an exception may be thrown.

public NameValueCollection GetValues()

Retreives the values of multiple columns, up to the size of the supplied array

public override int GetValues(object[])

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.GetValues() Method

Returns a collection containing all the column names and values for the current row of data in the current resultset, if any. If there is no current row or no current resultset, an exception may be thrown.

public NameValueCollection GetValues();

Return Value

The collection containing the column name and value information for the current row of data in the current resultset or null if this information cannot be obtained.

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace | SQLiteDataReader.GetValues Overload List


SQLiteDataReader.GetValues(Object) Method

Retreives the values of multiple columns, up to the size of the supplied array

public override int GetValues(
object[] values
);

Parameters

values
The array to fill with values from the columns in the current resultset

Return Value

The number of columns retrieved

Implements

IDataRecord.GetValues

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace | SQLiteDataReader.GetValues Overload List


SQLiteDataReader.IsDBNull Method

Returns True if the specified column is null

public override bool IsDBNull(
int i
);

Parameters

i
The index of the column to retrieve

Return Value

True or False

Implements

IDataRecord.IsDBNull

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.NextResult Method

Moves to the next resultset in multiple row-returning SQL command.

public override bool NextResult();

Return Value

True if the command was successful and a new resultset is available, False otherwise.

Implements

IDataReader.NextResult

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDataReader.Read Method

Reads the next row from the resultset

public override bool Read();

Return Value

True if a new row was successfully loaded and is ready for processing

Implements

IDataReader.Read

See Also

SQLiteDataReader Class | System.Data.SQLite Namespace


SQLiteDateFormats Enumeration

This implementation of SQLite for ADO.NET can process date/time fields in databases in only one of three formats. Ticks, ISO8601 and JulianDay.

public enum SQLiteDateFormats

Remarks

ISO8601 is more compatible, readable, fully-processable, but less accurate as it doesn't provide time down to fractions of a second. JulianDay is the numeric format the SQLite uses internally and is arguably the most compatible with 3rd party tools. It is not readable as text without post-processing. Ticks less compatible with 3rd party tools that query the database, and renders the DateTime field unreadable as text without post-processing. The preferred order of choosing a datetime format is JulianDay, ISO8601, and then Ticks. Ticks is mainly present for legacy code support.

Members

Member Name | Description
Ticks | Use the value of DateTime.Ticks. This value is not recommended and is not well supported with LINQ.
ISO8601 | Use the ISO-8601 format. Uses the "yyyy-MM-dd HH:mm:ss.FFFFFFFK" format for UTC DateTime values and "yyyy-MM-dd HH:mm:ss.FFFFFFF" format for local DateTime values).
JulianDay | The interval of time in days and fractions of a day since January 1, 4713 BC.
UnixEpoch | The whole number of seconds since the Unix epoch (January 1, 1970).
InvariantCulture | Any culture-independent string value that the .NET Framework can interpret as a valid DateTime.
CurrentCulture | Any string value that the .NET Framework can interpret as a valid DateTime using the current culture.
Default | The default format for this provider.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteErrorCode Enumeration

SQLite error codes. Actually, this enumeration represents a return code, which may also indicate success in one of several ways (e.g. SQLITE_OK, SQLITE_ROW, and SQLITE_DONE). Therefore, the name of this enumeration is something of a misnomer.

public enum SQLiteErrorCode

Members

Member Name | Description
Ok | Successful result
Error | SQL error or missing database
Internal | Internal logic error in SQLite
Perm | Access permission denied
Abort | Callback routine requested an abort
Busy | The database file is locked
Locked | A table in the database is locked
NoMem | A malloc() failed
ReadOnly | Attempt to write a readonly database
Interrupt | Operation terminated by sqlite3_interrupt()
IoErr | Some kind of disk I/O error occurred
Corrupt | The database disk image is malformed
NotFound | Unknown opcode in sqlite3_file_control()
Full | Insertion failed because database is full
CantOpen | Unable to open the database file
Protocol | Database lock protocol error
Empty | Database is empty
Schema | The database schema changed
TooBig | String or BLOB exceeds size limit
Constraint | Abort due to constraint violation
Mismatch | Data type mismatch
Misuse | Library used incorrectly
NoLfs | Uses OS features not supported on host
Auth | Authorization denied
Format | Auxiliary database format error
Range | 2nd parameter to sqlite3_bind out of range
NotADb | File opened that is not a database file
Notice | Notifications from sqlite3_log()
Warning | Warnings from sqlite3_log()
Row | sqlite3_step() has another row ready
Done | sqlite3_step() has finished executing

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteException Class

SQLite exception class.

For a list of all members of this type, see SQLiteException Members .

System.Object
Exception
SystemException
ExternalException
DbException
SQLiteException

public sealed class SQLiteException : DbException

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteException Members | System.Data.SQLite Namespace


SQLiteException Members

SQLiteException overview

Public Instance Constructors

SQLiteException Overloaded. Initializes a new instance of the SQLiteException class.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional, user-defined information about the exception.
ErrorCode | Gets the associated SQLite return code for this exception as an Int32. For desktop versions of the .NET Framework, this property overrides the property of the same name within the ExternalException class. This property returns the same underlying value as the ReturnCode property.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message (inherited from Exception) | Gets a message that describes the current exception.
ReturnCode | Gets the associated SQLite return code for this exception as a SQLiteErrorCode. This property returns the same underlying value as the ErrorCode property.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData | Adds extra information to the serialized object data specific to this class type. This is only used for serialization.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteException Class | System.Data.SQLite Namespace


SQLiteException Constructor

Public constructor for generating a SQLite exception given the error code and message.

Overload List

Public constructor that uses the default base class constructor.

public SQLiteException()

Public constructor for generating a SQLite exception given the error code and message.

public SQLiteException(SQLiteErrorCode,string)

Public constructor that uses the base class constructor for the error message.

public SQLiteException(string)

Public constructor that uses the base class constructor for the error message and inner exception.

public SQLiteException(string,Exception)

See Also

SQLiteException Class | System.Data.SQLite Namespace


SQLiteException Constructor

Public constructor for generating a SQLite exception given the error code and message.

SQLiteException(
SQLiteErrorCode errorCode,
string message
);

Parameters

errorCode
The SQLite return code to report.
message
Message text to go along with the return code message text.

See Also

SQLiteException Class | System.Data.SQLite Namespace | SQLiteException Constructor Overload List


SQLiteException Constructor

Public constructor that uses the base class constructor for the error message.

SQLiteException(
string message
);

Parameters

message
Error message text.

See Also

SQLiteException Class | System.Data.SQLite Namespace | SQLiteException Constructor Overload List


SQLiteException Constructor

Public constructor that uses the default base class constructor.

SQLiteException();

See Also

SQLiteException Class | System.Data.SQLite Namespace | SQLiteException Constructor Overload List


SQLiteException Constructor

Public constructor that uses the base class constructor for the error message and inner exception.

SQLiteException(
string message,
Exception innerException
);

Parameters

message
Error message text.
innerException
The original (inner) exception.

See Also

SQLiteException Class | System.Data.SQLite Namespace | SQLiteException Constructor Overload List


SQLiteException Properties

The properties of the SQLiteException class are listed below. For a complete list of SQLiteException class members, see the SQLiteException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional, user-defined information about the exception.
ErrorCode | Gets the associated SQLite return code for this exception as an Int32. For desktop versions of the .NET Framework, this property overrides the property of the same name within the ExternalException class. This property returns the same underlying value as the ReturnCode property.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message (inherited from Exception) | Gets a message that describes the current exception.
ReturnCode | Gets the associated SQLite return code for this exception as a SQLiteErrorCode. This property returns the same underlying value as the ErrorCode property.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

SQLiteException Class | System.Data.SQLite Namespace


ErrorCode Property

SQLite ADO.NET Provider

SQLiteException.ErrorCode Property

Gets the associated SQLite return code for this exception as an Int32. For desktop versions of the .NET Framework, this property overrides the property of the same name within the ExternalException class. This property returns the same underlying value as the ReturnCode property.

public override int ErrorCode { public get; }

See Also

SQLiteException Class | System.Data.SQLite Namespace


ReturnCode Property

SQLite ADO.NET Provider

SQLiteException.ReturnCode Property

Gets the associated SQLite return code for this exception as a SQLiteErrorCode. This property returns the same underlying value as the ErrorCode property.

public SQLiteErrorCode ReturnCode { public get; }

See Also

SQLiteException Class | System.Data.SQLite Namespace


SQLiteException Methods

The methods of the SQLiteException class are listed below. For a complete list of SQLiteException class members, see the SQLiteException Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData | Adds extra information to the serialized object data specific to this class type. This is only used for serialization.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteException Class | System.Data.SQLite Namespace


SQLiteException.GetObjectData Method

Adds extra information to the serialized object data specific to this class type. This is only used for serialization.

public override void GetObjectData(
SerializationInfo info,
StreamingContext context
);

Parameters

info
Holds the serialized object data about the exception being thrown.
context
Contains contextual information about the source or destination.

Implements

ISerializable.GetObjectData

See Also

SQLiteException Class | System.Data.SQLite Namespace


SQLiteExecuteType Enumeration

The requested command execution type. This controls which method of the SQLiteCommand object will be called.

public enum SQLiteExecuteType

Members

Member Name | Description
None | Do nothing. No method will be called.
NonQuery | The command is not expected to return a result -OR- the result is not needed. The ExecuteNonQuery method will be called.
Scalar | The command is expected to return a scalar result -OR- the result should be limited to a scalar result. The ExecuteScalar method will be called.
Reader | The command is expected to return SQLiteDataReader result. The ExecuteReader method will be called.
Default | Use the default command execution type. Using this value is the same as using the None value.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteFactory Class

SQLite implementation of DbProviderFactory.

SQLite implementation of IServiceProvider.

For a list of all members of this type, see SQLiteFactory Members .

System.Object
DbProviderFactory
SQLiteFactory

public sealed class SQLiteFactory : DbProviderFactory, IDisposable, IServiceProvider

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteFactory Members | System.Data.SQLite Namespace


SQLiteFactory Members

SQLiteFactory overview

Public Static Fields

Instance Static instance member which returns an instanced SQLiteFactory class.

Public Instance Constructors

SQLiteFactory Constructor Constructs a new instance.

Public Instance Properties

CanCreateDataSourceEnumerator (inherited from DbProviderFactory) Specifies whether the specific DbProviderFactory supports the DbDataSourceEnumerator class.

Public Instance Methods

CreateCommand | Creates and returns a new SQLiteCommand object.
CreateCommandBuilder | Creates and returns a new SQLiteCommandBuilder object.
CreateConnection | Creates and returns a new SQLiteConnection object.
CreateConnectionStringBuilder | Creates and returns a new SQLiteConnectionStringBuilder object.
CreateDataAdapter | Creates and returns a new SQLiteDataAdapter object.
CreateDataSourceEnumerator (inherited from DbProviderFactory) | Returns a new instance of the provider's class that implements the DbDataSourceEnumerator class.
CreateParameter | Creates and returns a new SQLiteParameter object.
CreatePermission (inherited from DbProviderFactory) | Returns a new instance of the provider's class that implements the provider's version of the CodeAccessPermission class.
Dispose |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

Log This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application. This event is provided for backward compatibility only. New code should use the SQLiteLog class instead.

Protected Instance Methods

Finalize |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory Constructor

Constructs a new instance.

SQLiteFactory();

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory Fields

The fields of the SQLiteFactory class are listed below. For a complete list of SQLiteFactory class members, see the SQLiteFactory Members topic.

Public Static Fields

Instance Static instance member which returns an instanced SQLiteFactory class.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.Instance Field

Static instance member which returns an instanced SQLiteFactory class.

public static readonly SQLiteFactory Instance;

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory Methods

The methods of the SQLiteFactory class are listed below. For a complete list of SQLiteFactory class members, see the SQLiteFactory Members topic.

Public Instance Methods

CreateCommand | Creates and returns a new SQLiteCommand object.
CreateCommandBuilder | Creates and returns a new SQLiteCommandBuilder object.
CreateConnection | Creates and returns a new SQLiteConnection object.
CreateConnectionStringBuilder | Creates and returns a new SQLiteConnectionStringBuilder object.
CreateDataAdapter | Creates and returns a new SQLiteDataAdapter object.
CreateDataSourceEnumerator (inherited from DbProviderFactory) | Returns a new instance of the provider's class that implements the DbDataSourceEnumerator class.
CreateParameter | Creates and returns a new SQLiteParameter object.
CreatePermission (inherited from DbProviderFactory) | Returns a new instance of the provider's class that implements the provider's version of the CodeAccessPermission class.
Dispose |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateCommand Method

Creates and returns a new SQLiteCommand object.

public override DbCommand CreateCommand();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateCommandBuilder Method

Creates and returns a new SQLiteCommandBuilder object.

public override DbCommandBuilder CreateCommandBuilder();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateConnection Method

Creates and returns a new SQLiteConnection object.

public override DbConnection CreateConnection();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateConnectionStringBuilder Method

Creates and returns a new SQLiteConnectionStringBuilder object.

public override DbConnectionStringBuilder CreateConnectionStringBuilder();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateDataAdapter Method

Creates and returns a new SQLiteDataAdapter object.

public override DbDataAdapter CreateDataAdapter();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.CreateParameter Method

Creates and returns a new SQLiteParameter object.

public override DbParameter CreateParameter();

Return Value

The new object.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.Dispose Method

public void Dispose();

Implements

IDisposable.Dispose

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.Finalize Method

protected override void Finalize();

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory Events

The events of the SQLiteFactory class are listed below. For a complete list of SQLiteFactory class members, see the SQLiteFactory Members topic.

Public Instance Events

Log This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application. This event is provided for backward compatibility only. New code should use the SQLiteLog class instead.

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFactory.Log Event

This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application. This event is provided for backward compatibility only. New code should use the SQLiteLog class instead.

public event SQLiteLogEventHandler Log;

See Also

SQLiteFactory Class | System.Data.SQLite Namespace


SQLiteFunction Class

This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each connection to the database.

For a list of all members of this type, see SQLiteFunction Members .

System.Object
SQLiteFunction
SQLiteFunctionEx

public abstract class SQLiteFunction : IDisposable

Remarks

Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access to the underlying connection. This is necessary to deter implementers from thinking it would be a good idea to make database calls during processing. It is important to distinguish between a per-connection instance, and a per-SQL statement context. One instance of this class services all SQL statements being stepped through on that connection, and there can be many. One should never store per-statement information in member variables of user-defined function classes. For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step. This data will be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteFunction Members | System.Data.SQLite Namespace


SQLiteFunction Members

SQLiteFunction overview

Public Static Methods

RegisterFunction Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported.

Public Instance Properties

SQLiteConvert Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert strings and DateTime's into the current connection's encoding schema.

Public Instance Methods

Compare | User-defined collation sequences override this method to provide a custom string sorting algorithm.
Dispose | Overloaded. Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Final | Aggregate functions override this method to finish their aggregate processing.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Invoke | Scalar functions override this method to do their magic.
Step | Aggregate functions override this method to do their magic.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Constructors

SQLiteFunction Constructor Internal constructor, initializes the function's internal variables.

Protected Instance Methods

Dispose | Overloaded. Placeholder for a user-defined disposal routine
Finalize |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction Constructor

Internal constructor, initializes the function's internal variables.

SQLiteFunction();

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction Properties

The properties of the SQLiteFunction class are listed below. For a complete list of SQLiteFunction class members, see the SQLiteFunction Members topic.

Public Instance Properties

SQLiteConvert Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert strings and DateTime's into the current connection's encoding schema.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteConvert Property

SQLite ADO.NET Provider

SQLiteFunction.SQLiteConvert Property

Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert strings and DateTime's into the current connection's encoding schema.

public SQLiteConvert SQLiteConvert { public get; }

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction Methods

The methods of the SQLiteFunction class are listed below. For a complete list of SQLiteFunction class members, see the SQLiteFunction Members topic.

Public Static Methods

RegisterFunction Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported.

Public Instance Methods

Compare | User-defined collation sequences override this method to provide a custom string sorting algorithm.
Dispose | Overloaded. Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Final | Aggregate functions override this method to finish their aggregate processing.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Invoke | Scalar functions override this method to do their magic.
Step | Aggregate functions override this method to do their magic.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded. Placeholder for a user-defined disposal routine
Finalize |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.Compare Method

User-defined collation sequences override this method to provide a custom string sorting algorithm.

public virtual int Compare(
string param1,
string param2
);

Parameters

param1
The first string to compare
param2
The second strnig to compare

Return Value

1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteFunction.Dispose Method

Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.

Overload List

Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.

public void Dispose()

Placeholder for a user-defined disposal routine

protected virtual void Dispose(bool)

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.Dispose() Method

Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.

public void Dispose();

Implements

IDisposable.Dispose

See Also

SQLiteFunction Class | System.Data.SQLite Namespace | SQLiteFunction.Dispose Overload List


SQLiteFunction.Dispose(Boolean) Method

Placeholder for a user-defined disposal routine

protected virtual void Dispose(
bool disposing
);

Parameters

disposing
True if the object is being disposed explicitly

See Also

SQLiteFunction Class | System.Data.SQLite Namespace | SQLiteFunction.Dispose Overload List


SQLiteFunction.Final Method

Aggregate functions override this method to finish their aggregate processing.

public virtual object Final(
object contextData
);

Parameters

contextData
Your own assigned contextData, provided for you so you can return your final results.

Return Value

You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, just return it!

Remarks

If you implemented your aggregate function properly, you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have all the information you need in there to figure out what to return. NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value if that is the case.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.Finalize Method

protected override void Finalize();

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.Invoke Method

Scalar functions override this method to do their magic.

public virtual object Invoke(
object[] args
);

Parameters

args
The arguments for the command to process

Return Value

You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, just return it!

Remarks

Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available to force them into a certain type. Therefore the only types you will ever see as parameters are DBNull.Value, Int64, Double, String or byte[] array.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.RegisterFunction Method

Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported.

public static void RegisterFunction(
Type typ
);

Parameters

typ
The type of the function to register

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunction.Step Method

Aggregate functions override this method to do their magic.

public virtual void Step(
object[] args,
int stepNumber,
ref object contextData
);

Parameters

args
The arguments for the command to process
stepNumber
The 1-based step number. This is incrememted each time the step method is called.
contextData
A placeholder for implementers to store contextual data pertaining to the current context.

Remarks

Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible.

See Also

SQLiteFunction Class | System.Data.SQLite Namespace


SQLiteFunctionAttribute Class

A simple custom attribute to enable us to easily find user-defined functions in the loaded assemblies and initialize them in SQLite as connections are made.

For a list of all members of this type, see SQLiteFunctionAttribute Members .

System.Object
Attribute
SQLiteFunctionAttribute

public sealed class SQLiteFunctionAttribute : Attribute

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteFunctionAttribute Members | System.Data.SQLite Namespace


SQLiteFunctionAttribute Members

SQLiteFunctionAttribute overview

Public Instance Constructors

SQLiteFunctionAttribute Constructor Default constructor, initializes the internal variables for the function.

Public Instance Properties

Arguments | The number of arguments this function expects. -1 if the number of arguments is variable.
FuncType | The type of function this implementation will be.
Name | The function's name as it will be used in SQLite command text.
TypeId (inherited from Attribute) | When implemented in a derived class, gets a unique identifier for this Attribute.

Public Instance Methods

Equals (inherited from Attribute) | Returns a value that indicates whether this instance is equal to a specified object.
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


SQLiteFunctionAttribute Constructor

Default constructor, initializes the internal variables for the function.

SQLiteFunctionAttribute();

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


SQLiteFunctionAttribute Properties

The properties of the SQLiteFunctionAttribute class are listed below. For a complete list of SQLiteFunctionAttribute class members, see the SQLiteFunctionAttribute Members topic.

Public Instance Properties

Arguments | The number of arguments this function expects. -1 if the number of arguments is variable.
FuncType | The type of function this implementation will be.
Name | The function's name as it will be used in SQLite command text.
TypeId (inherited from Attribute) | When implemented in a derived class, gets a unique identifier for this Attribute.

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


Arguments Property

SQLite ADO.NET Provider

SQLiteFunctionAttribute.Arguments Property

The number of arguments this function expects. -1 if the number of arguments is variable.

public int Arguments { public get; public set; }

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


FuncType Property

SQLite ADO.NET Provider

SQLiteFunctionAttribute.FuncType Property

The type of function this implementation will be.

public FunctionType FuncType { public get; public set; }

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


Name Property

SQLite ADO.NET Provider

SQLiteFunctionAttribute.Name Property

The function's name as it will be used in SQLite command text.

public string Name { public get; public set; }

See Also

SQLiteFunctionAttribute Class | System.Data.SQLite Namespace


SQLiteFunctionEx Class

Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call.

For a list of all members of this type, see SQLiteFunctionEx Members .

System.Object
SQLiteFunction
SQLiteFunctionEx

public class SQLiteFunctionEx : SQLiteFunction

Remarks

User-defined functions can call the GetCollationSequence() method in this class and use it to compare strings and char arrays.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteFunctionEx Members | System.Data.SQLite Namespace


SQLiteFunctionEx Members

SQLiteFunctionEx overview

Public Instance Constructors

SQLiteFunctionEx Constructor Initializes a new instance of the SQLiteFunctionEx class.

Public Instance Properties

SQLiteConvert (inherited from SQLiteFunction) Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert strings and DateTime's into the current connection's encoding schema.

Public Instance Methods

Compare (inherited from SQLiteFunction) | User-defined collation sequences override this method to provide a custom string sorting algorithm.
Dispose (inherited from SQLiteFunction) | Overloaded. Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Final (inherited from SQLiteFunction) | Aggregate functions override this method to finish their aggregate processing.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Invoke (inherited from SQLiteFunction) | Scalar functions override this method to do their magic.
Step (inherited from SQLiteFunction) | Aggregate functions override this method to do their magic.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded.
Finalize (inherited from SQLiteFunction) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetCollationSequence | Obtains the collating sequence in effect for the given function.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace


SQLiteFunctionEx Constructor

Initializes a new instance of the SQLiteFunctionEx class.

SQLiteFunctionEx();

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace


SQLiteFunctionEx Methods

The methods of the SQLiteFunctionEx class are listed below. For a complete list of SQLiteFunctionEx class members, see the SQLiteFunctionEx Members topic.

Public Instance Methods

Compare (inherited from SQLiteFunction) | User-defined collation sequences override this method to provide a custom string sorting algorithm.
Dispose (inherited from SQLiteFunction) | Overloaded. Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if someone closes the connection while a DataReader is open.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Final (inherited from SQLiteFunction) | Aggregate functions override this method to finish their aggregate processing.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Invoke (inherited from SQLiteFunction) | Scalar functions override this method to do their magic.
Step (inherited from SQLiteFunction) | Aggregate functions override this method to do their magic.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded.
Finalize (inherited from SQLiteFunction) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetCollationSequence | Obtains the collating sequence in effect for the given function.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteFunctionEx.Dispose Method

Overload List

Inherited from SQLiteFunction.

public void Dispose()

protected override void Dispose(bool)

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace


SQLiteFunctionEx.Dispose(Boolean) Method

protected override void Dispose(
bool disposing
);

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace | SQLiteFunctionEx.Dispose Overload List


SQLiteFunctionEx.GetCollationSequence Method

Obtains the collating sequence in effect for the given function.

protected CollationSequence GetCollationSequence();

Return Value

See Also

SQLiteFunctionEx Class | System.Data.SQLite Namespace


SQLiteJournalModeEnum Enumeration

This enum determines how SQLite treats its journal file.

public enum SQLiteJournalModeEnum

Remarks

By default SQLite will create and delete the journal file when needed during a transaction. However, for some computers running certain filesystem monitoring tools, the rapid creation and deletion of the journal file can cause those programs to fail, or to interfere with SQLite. If a program or virus scanner is interfering with SQLite's journal file, you may receive errors like "unable to open database file" when starting a transaction. If this is happening, you may want to change the default journal mode to Persist.

Members

Member Name | Description
Default | The default mode, this causes SQLite to use the existing journaling mode for the database.
Delete | SQLite will create and destroy the journal file as-needed.
Persist | When this is set, SQLite will keep the journal file even after a transaction has completed. It's contents will be erased, and the journal re-used as often as needed. If it is deleted, it will be recreated the next time it is needed.
Off | This option disables the rollback journal entirely. Interrupted transactions or a program crash can cause database corruption in this mode!
Truncate | SQLite will truncate the journal file to zero-length instead of deleting it.
Memory | SQLite will store the journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the database file will very likely go corrupt.
Wal | SQLite uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; after being set it stays in effect across multiple database connections and after closing and reopening the database. A database in WAL journaling mode can only be accessed by SQLite version 3.7.0 or later.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteLog Class

Manages the SQLite custom logging functionality and the associated callback for the whole process.

For a list of all members of this type, see SQLiteLog Members .

System.Object
SQLiteLog

public static class SQLiteLog

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteLog Members | System.Data.SQLite Namespace


SQLiteLog Members

SQLiteLog overview

Public Static Properties

Enabled If this property is true, logging is enabled; otherwise, logging is disabled. When logging is disabled, no logging events will fire.

Public Static Methods

AddDefaultHandler | Adds the default log event handler to the list of handlers.
Initialize | Initializes the SQLite logging facilities.
LogMessage | Overloaded. Log a message to all the registered log event handlers without going through the SQLite library.
RemoveDefaultHandler | Removes the default log event handler from the list of handlers.

Public Static Events

Log This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog Properties

The properties of the SQLiteLog class are listed below. For a complete list of SQLiteLog class members, see the SQLiteLog Members topic.

Public Static Properties

Enabled If this property is true, logging is enabled; otherwise, logging is disabled. When logging is disabled, no logging events will fire.

See Also

SQLiteLog Class | System.Data.SQLite Namespace


Enabled Property

SQLite ADO.NET Provider

SQLiteLog.Enabled Property

If this property is true, logging is enabled; otherwise, logging is disabled. When logging is disabled, no logging events will fire.

public static bool Enabled { public get; public set; }

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog Methods

The methods of the SQLiteLog class are listed below. For a complete list of SQLiteLog class members, see the SQLiteLog Members topic.

Public Static Methods

AddDefaultHandler | Adds the default log event handler to the list of handlers.
Initialize | Initializes the SQLite logging facilities.
LogMessage | Overloaded. Log a message to all the registered log event handlers without going through the SQLite library.
RemoveDefaultHandler | Removes the default log event handler from the list of handlers.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog.AddDefaultHandler Method

Adds the default log event handler to the list of handlers.

public static void AddDefaultHandler();

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog.Initialize Method

Initializes the SQLite logging facilities.

public static void Initialize();

See Also

SQLiteLog Class | System.Data.SQLite Namespace


LogMessage Method

SQLite ADO.NET Provider

SQLiteLog.LogMessage Method

Log a message to all the registered log event handlers without going through the SQLite library.

Overload List

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(SQLiteErrorCode,string)

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(int,string)

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(string)

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog.LogMessage(SQLiteErrorCode, String) Method

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(
SQLiteErrorCode errorCode,
string message
);

Parameters

errorCode
The SQLite error code.
message
The message to be logged.

See Also

SQLiteLog Class | System.Data.SQLite Namespace | SQLiteLog.LogMessage Overload List


SQLiteLog.LogMessage(Int32, String) Method

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(
int errorCode,
string message
);

Parameters

errorCode
The integer error code.
message
The message to be logged.

See Also

SQLiteLog Class | System.Data.SQLite Namespace | SQLiteLog.LogMessage Overload List


SQLiteLog.LogMessage(String) Method

Log a message to all the registered log event handlers without going through the SQLite library.

public static void LogMessage(
string message
);

Parameters

message
The message to be logged.

See Also

SQLiteLog Class | System.Data.SQLite Namespace | SQLiteLog.LogMessage Overload List


SQLiteLog.RemoveDefaultHandler Method

Removes the default log event handler from the list of handlers.

public static void RemoveDefaultHandler();

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog Events

The events of the SQLiteLog class are listed below. For a complete list of SQLiteLog class members, see the SQLiteLog Members topic.

Public Static Events

Log This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application.

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLog.Log Event

This event is raised whenever SQLite raises a logging event. Note that this should be set as one of the first things in the application.

public static event SQLiteLogEventHandler Log;

See Also

SQLiteLog Class | System.Data.SQLite Namespace


SQLiteLogEventHandler Delegate

Raised when a log event occurs.

public delegate void SQLiteLogEventHandler(
object sender,
LogEventArgs e
);

Parameters

sender
The current connection
e
Event arguments of the trace

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames Class

MetaDataCollections specific to SQLite

For a list of all members of this type, see SQLiteMetaDataCollectionNames Members .

System.Object
SQLiteMetaDataCollectionNames

public static class SQLiteMetaDataCollectionNames

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteMetaDataCollectionNames Members | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames Members

SQLiteMetaDataCollectionNames overview

Public Static Fields

Catalogs | Returns a list of databases attached to the connection
Columns | Returns column information for the specified table
ForeignKeys | Returns foreign key information for the given catalog
IndexColumns | Returns base columns for the given index
Indexes | Returns index information for the optionally-specified table
Tables | Returns the tables in the given catalog
Triggers | Returns the triggers on the database
ViewColumns | Returns underlying column information on the given view
Views | Returns user-defined views in the given catalog

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames Fields

The fields of the SQLiteMetaDataCollectionNames class are listed below. For a complete list of SQLiteMetaDataCollectionNames class members, see the SQLiteMetaDataCollectionNames Members topic.

Public Static Fields

Catalogs | Returns a list of databases attached to the connection
Columns | Returns column information for the specified table
ForeignKeys | Returns foreign key information for the given catalog
IndexColumns | Returns base columns for the given index
Indexes | Returns index information for the optionally-specified table
Tables | Returns the tables in the given catalog
Triggers | Returns the triggers on the database
ViewColumns | Returns underlying column information on the given view
Views | Returns user-defined views in the given catalog

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Catalogs Field

Returns a list of databases attached to the connection

public static readonly string Catalogs;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Columns Field

Returns column information for the specified table

public static readonly string Columns;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.ForeignKeys Field

Returns foreign key information for the given catalog

public static readonly string ForeignKeys;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.IndexColumns Field

Returns base columns for the given index

public static readonly string IndexColumns;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Indexes Field

Returns index information for the optionally-specified table

public static readonly string Indexes;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Tables Field

Returns the tables in the given catalog

public static readonly string Tables;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Triggers Field

Returns the triggers on the database

public static readonly string Triggers;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.ViewColumns Field

Returns underlying column information on the given view

public static readonly string ViewColumns;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteMetaDataCollectionNames.Views Field

Returns user-defined views in the given catalog

public static readonly string Views;

See Also

SQLiteMetaDataCollectionNames Class | System.Data.SQLite Namespace


SQLiteParameter Class

SQLite implementation of DbParameter.

For a list of all members of this type, see SQLiteParameter Members .

System.Object
MarshalByRefObject
DbParameter
SQLiteParameter

public sealed class SQLiteParameter : DbParameter, ICloneable

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteParameter Members | System.Data.SQLite Namespace


SQLiteParameter Members

SQLiteParameter overview

Public Instance Constructors

SQLiteParameter Overloaded. Initializes a new instance of the SQLiteParameter class.

Public Instance Properties

DbType | Returns the datatype of the parameter
Direction | Supports only input parameters
IsNullable | Whether or not the parameter can contain a null value
ParameterName | Returns the parameter name
Size | Returns the size of the parameter
SourceColumn | Gets/sets the source column
SourceColumnNullMapping | Used by DbCommandBuilder to determine the mapping for nullable fields
SourceVersion | Gets and sets the row version
Value | Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given.

Public Instance Methods

Clone | Clones a parameter
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ResetDbType | Resets the DbType of the parameter so it can be inferred from the value
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameter Constructor

Default constructor

Overload List

Default constructor

public SQLiteParameter()

Constructs an unnamed parameter of the specified data type

public SQLiteParameter(DbType)

Constructs an unnamed parameter of the specified type and size

public SQLiteParameter(DbType,int)

Constructs an unnamed parameter of the specified type, size, and source column

public SQLiteParameter(DbType,int,string)

Constructs an unnamed parameter of the specified type, size, source column and row version

public SQLiteParameter(DbType,int,string,DataRowVersion)

Constructs an unnamed parameter of the specified data type and sets the initial value

public SQLiteParameter(DbType,object)

Constructs an unnamed parameter of the specified data type and source column

public SQLiteParameter(DbType,string)

Constructs an unnamed parameter of the specified data type, source column and row version

public SQLiteParameter(DbType,string,DataRowVersion)

Constructs a named parameter given the specified parameter name

public SQLiteParameter(string)

Constructs a named parameter of the specified type

public SQLiteParameter(string,DbType)

Constructs a named parameter of the specified type and size

public SQLiteParameter(string,DbType,int)

Constructs a named parameter of the specified type, size, source column and row version

public SQLiteParameter(string,DbType,int,ParameterDirection,bool,byte,byte,string,DataRowVersion,object)

Constructs a named parameter, yet another flavor

public SQLiteParameter(string,DbType,int,ParameterDirection,byte,byte,string,DataRowVersion,bool,object)

Constructs a named parameter of the specified type, size and source column

public SQLiteParameter(string,DbType,int,string)

Constructs a named parameter of the specified type, size, source column and row version

public SQLiteParameter(string,DbType,int,string,DataRowVersion)

Constructs a named parameter of the specified type and source column reference

public SQLiteParameter(string,DbType,string)

Constructs a named parameter of the specified type, source column and row version

public SQLiteParameter(string,DbType,string,DataRowVersion)

Constructs a named parameter given the specified parameter name and initial value

public SQLiteParameter(string,object)

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameter Constructor

Default constructor

SQLiteParameter();

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter given the specified parameter name

SQLiteParameter(
string parameterName
);

Parameters

parameterName
The parameter name

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter given the specified parameter name and initial value

SQLiteParameter(
string parameterName,
object value
);

Parameters

parameterName
The parameter name
value
The initial value of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type

SQLiteParameter(
string parameterName,
DbType dbType
);

Parameters

parameterName
The parameter name
dbType
The datatype of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type and source column reference

SQLiteParameter(
string parameterName,
DbType dbType,
string sourceColumn
);

Parameters

parameterName
The parameter name
dbType
The data type
sourceColumn
The source column

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type, source column and row version

SQLiteParameter(
string parameterName,
DbType dbType,
string sourceColumn,
DataRowVersion rowVersion
);

Parameters

parameterName
The parameter name
dbType
The data type
sourceColumn
The source column
rowVersion
The row version information

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified data type

SQLiteParameter(
DbType dbType
);

Parameters

dbType
The datatype of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified data type and sets the initial value

SQLiteParameter(
DbType dbType,
object value
);

Parameters

dbType
The datatype of the parameter
value
The initial value of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified data type and source column

SQLiteParameter(
DbType dbType,
string sourceColumn
);

Parameters

dbType
The datatype of the parameter
sourceColumn
The source column

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified data type, source column and row version

SQLiteParameter(
DbType dbType,
string sourceColumn,
DataRowVersion rowVersion
);

Parameters

dbType
The data type
sourceColumn
The source column
rowVersion
The row version information

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type and size

SQLiteParameter(
string parameterName,
DbType parameterType,
int parameterSize
);

Parameters

parameterName
The parameter name
parameterType
The data type
parameterSize
The size of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type, size and source column

SQLiteParameter(
string parameterName,
DbType parameterType,
int parameterSize,
string sourceColumn
);

Parameters

parameterName
The name of the parameter
parameterType
The data type
parameterSize
The size of the parameter
sourceColumn
The source column

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type, size, source column and row version

SQLiteParameter(
string parameterName,
DbType parameterType,
int parameterSize,
string sourceColumn,
DataRowVersion rowVersion
);

Parameters

parameterName
The name of the parameter
parameterType
The data type
parameterSize
The size of the parameter
sourceColumn
The source column
rowVersion
The row version information

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter of the specified type, size, source column and row version

SQLiteParameter(
string parameterName,
DbType parameterType,
int parameterSize,
ParameterDirection direction,
bool isNullable,
byte precision,
byte scale,
string sourceColumn,
DataRowVersion rowVersion,
object value
);

Parameters

parameterName
The name of the parameter
parameterType
The data type
parameterSize
The size of the parameter
direction
Only input parameters are supported in SQLite
isNullable
Ignored
precision
Ignored
scale
Ignored
sourceColumn
The source column
rowVersion
The row version information
value
The initial value to assign the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs a named parameter, yet another flavor

SQLiteParameter(
string parameterName,
DbType parameterType,
int parameterSize,
ParameterDirection direction,
byte precision,
byte scale,
string sourceColumn,
DataRowVersion rowVersion,
bool sourceColumnNullMapping,
object value
);

Parameters

parameterName
The name of the parameter
parameterType
The data type
parameterSize
The size of the parameter
direction
Only input parameters are supported in SQLite
precision
Ignored
scale
Ignored
sourceColumn
The source column
rowVersion
The row version information
sourceColumnNullMapping
Whether or not this parameter is for comparing NULL's
value
The intial value to assign the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified type and size

SQLiteParameter(
DbType parameterType,
int parameterSize
);

Parameters

parameterType
The data type
parameterSize
The size of the parameter

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified type, size, and source column

SQLiteParameter(
DbType parameterType,
int parameterSize,
string sourceColumn
);

Parameters

parameterType
The data type
parameterSize
The size of the parameter
sourceColumn
The source column

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Constructor

Constructs an unnamed parameter of the specified type, size, source column and row version

SQLiteParameter(
DbType parameterType,
int parameterSize,
string sourceColumn,
DataRowVersion rowVersion
);

Parameters

parameterType
The data type
parameterSize
The size of the parameter
sourceColumn
The source column
rowVersion
The row version information

See Also

SQLiteParameter Class | System.Data.SQLite Namespace | SQLiteParameter Constructor Overload List


SQLiteParameter Properties

The properties of the SQLiteParameter class are listed below. For a complete list of SQLiteParameter class members, see the SQLiteParameter Members topic.

Public Instance Properties

DbType | Returns the datatype of the parameter
Direction | Supports only input parameters
IsNullable | Whether or not the parameter can contain a null value
ParameterName | Returns the parameter name
Size | Returns the size of the parameter
SourceColumn | Gets/sets the source column
SourceColumnNullMapping | Used by DbCommandBuilder to determine the mapping for nullable fields
SourceVersion | Gets and sets the row version
Value | Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given.

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


DbType Property

SQLite ADO.NET Provider

SQLiteParameter.DbType Property

Returns the datatype of the parameter

public override DbType DbType { public get; public set; }

Implements

IDataParameter.DbType

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


Direction Property

SQLite ADO.NET Provider

SQLiteParameter.Direction Property

Supports only input parameters

public override ParameterDirection Direction { public get; public set; }

Implements

IDataParameter.Direction

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


IsNullable Property

SQLite ADO.NET Provider

SQLiteParameter.IsNullable Property

Whether or not the parameter can contain a null value

public override bool IsNullable { public get; public set; }

Implements

IDataParameter.IsNullable

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


ParameterName Property

SQLite ADO.NET Provider

SQLiteParameter.ParameterName Property

Returns the parameter name

public override string ParameterName { public get; public set; }

Implements

IDataParameter.ParameterName

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


Size Property

SQLite ADO.NET Provider

SQLiteParameter.Size Property

Returns the size of the parameter

public override int Size { public get; public set; }

Implements

IDbDataParameter.Size

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SourceColumn Property

SQLite ADO.NET Provider

SQLiteParameter.SourceColumn Property

Gets/sets the source column

public override string SourceColumn { public get; public set; }

Implements

IDataParameter.SourceColumn

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SourceColumnNullMapping Property

SQLite ADO.NET Provider

SQLiteParameter.SourceColumnNullMapping Property

Used by DbCommandBuilder to determine the mapping for nullable fields

public override bool SourceColumnNullMapping { public get; public set; }

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SourceVersion Property

SQLite ADO.NET Provider

SQLiteParameter.SourceVersion Property

Gets and sets the row version

public override DataRowVersion SourceVersion { public get; public set; }

Implements

IDataParameter.SourceVersion

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


Value Property

SQLite ADO.NET Provider

SQLiteParameter.Value Property

Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given.

public override object Value { public get; public set; }

Implements

IDataParameter.Value

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameter Methods

The methods of the SQLiteParameter class are listed below. For a complete list of SQLiteParameter class members, see the SQLiteParameter Members topic.

Public Instance Methods

Clone | Clones a parameter
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ResetDbType | Resets the DbType of the parameter so it can be inferred from the value
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameter.Clone Method

Clones a parameter

public object Clone();

Return Value

A new, unassociated SQLiteParameter

Implements

ICloneable.Clone

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameter.ResetDbType Method

Resets the DbType of the parameter so it can be inferred from the value

public override void ResetDbType();

See Also

SQLiteParameter Class | System.Data.SQLite Namespace


SQLiteParameterCollection Class

SQLite implementation of DbParameterCollection.

For a list of all members of this type, see SQLiteParameterCollection Members .

System.Object
MarshalByRefObject
DbParameterCollection
SQLiteParameterCollection

public sealed class SQLiteParameterCollection : DbParameterCollection

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteParameterCollection Members | System.Data.SQLite Namespace


SQLiteParameterCollection Members

SQLiteParameterCollection overview

Public Instance Properties

Count | Returns a count of parameters in the collection
IsFixedSize | Returns false
IsReadOnly | Returns false
IsSynchronized | Returns true
Item | Overloaded. Overloaded to specialize the return value of the default indexer
SyncRoot | Returns null

Public Instance Methods

Add | Overloaded. Adds a parameter to the collection
AddRange | Overloaded. Adds an array of parameters to the collection
AddWithValue | Adds a named/unnamed parameter and its value to the parameter collection.
Clear | Clears the array and resets the collection
Contains | Overloaded. Determines if the named parameter exists in the collection
CopyTo | Not implemented
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Retrieves an enumerator for the collection
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Overloaded. Returns the index of a parameter given its name
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Insert | Inserts a parameter into the array at the specified location
Remove | Removes a parameter from the collection
RemoveAt | Overloaded. Removes a parameter from the collection given its name
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetParameter | Overloaded. Retrieve a parameter by name from the collection
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
SetParameter | Overloaded. Re-assign the named parameter to a new parameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection Properties

The properties of the SQLiteParameterCollection class are listed below. For a complete list of SQLiteParameterCollection class members, see the SQLiteParameterCollection Members topic.

Public Instance Properties

Count | Returns a count of parameters in the collection
IsFixedSize | Returns false
IsReadOnly | Returns false
IsSynchronized | Returns true
Item | Overloaded. Overloaded to specialize the return value of the default indexer
SyncRoot | Returns null

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


Count Property

SQLite ADO.NET Provider

SQLiteParameterCollection.Count Property

Returns a count of parameters in the collection

public override int Count { public get; }

Implements

ICollection.Count

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


IsFixedSize Property

SQLite ADO.NET Provider

SQLiteParameterCollection.IsFixedSize Property

Returns false

public override bool IsFixedSize { public get; }

Implements

IList.IsFixedSize

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


IsReadOnly Property

SQLite ADO.NET Provider

SQLiteParameterCollection.IsReadOnly Property

Returns false

public override bool IsReadOnly { public get; }

Implements

IList.IsReadOnly

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


IsSynchronized Property

SQLite ADO.NET Provider

SQLiteParameterCollection.IsSynchronized Property

Returns true

public override bool IsSynchronized { public get; }

Implements

ICollection.IsSynchronized

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameter Property

SQLite ADO.NET Provider

SQLiteParameterCollection.SQLiteParameter Property

Overloaded to specialize the return value of the default indexer

Overload List

Overloaded to specialize the return value of the default indexer

public SQLiteParameter this[ int] { public get; public set; }

Overloaded to specialize the return value of the default indexer

public SQLiteParameter this[ string] { public get; public set; }

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


Item Property

SQLite ADO.NET Provider

SQLiteParameterCollection.Item Property

Overloaded to specialize the return value of the default indexer

public SQLiteParameter this[
int index
] { public get; public set; }

Parameters

index
The index of the parameter to get/set

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Item Overload List


Item Property

SQLite ADO.NET Provider

SQLiteParameterCollection.Item Property

Overloaded to specialize the return value of the default indexer

public SQLiteParameter this[
string parameterName
] { public get; public set; }

Parameters

parameterName
Name of the parameter to get/set

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Item Overload List


SyncRoot Property

SQLite ADO.NET Provider

SQLiteParameterCollection.SyncRoot Property

Returns null

public override object SyncRoot { public get; }

Implements

ICollection.SyncRoot

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection Methods

The methods of the SQLiteParameterCollection class are listed below. For a complete list of SQLiteParameterCollection class members, see the SQLiteParameterCollection Members topic.

Public Instance Methods

Add | Overloaded. Adds a parameter to the collection
AddRange | Overloaded. Adds an array of parameters to the collection
AddWithValue | Adds a named/unnamed parameter and its value to the parameter collection.
Clear | Clears the array and resets the collection
Contains | Overloaded. Determines if the named parameter exists in the collection
CopyTo | Not implemented
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Retrieves an enumerator for the collection
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Overloaded. Returns the index of a parameter given its name
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Insert | Inserts a parameter into the array at the specified location
Remove | Removes a parameter from the collection
RemoveAt | Overloaded. Removes a parameter from the collection given its name
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetParameter | Overloaded. Retrieve a parameter by name from the collection
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.
SetParameter | Overloaded. Re-assign the named parameter to a new parameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


Add Method

SQLite ADO.NET Provider

SQLiteParameterCollection.Add Method

Adds a parameter to the collection

Overload List

Adds a parameter to the collection

public int Add(SQLiteParameter)

Adds a parameter to the collection

public override int Add(object)

Adds a parameter to the collection

public SQLiteParameter Add(string,DbType)

Adds a parameter to the collection

public SQLiteParameter Add(string,DbType,int)

Adds a parameter to the collection

public SQLiteParameter Add(string,DbType,int,string)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.Add(SQLiteParameter) Method

Adds a parameter to the collection

public int Add(
SQLiteParameter parameter
);

Parameters

parameter
The parameter to add

Return Value

A zero-based index of where the parameter is located in the array

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Add Overload List


SQLiteParameterCollection.Add(Object) Method

Adds a parameter to the collection

public override int Add(
object value
);

Parameters

value
The parameter to add

Return Value

A zero-based index of where the parameter is located in the array

Implements

IList.Add

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Add Overload List


SQLiteParameterCollection.Add(String, DbType) Method

Adds a parameter to the collection

public SQLiteParameter Add(
string parameterName,
DbType parameterType
);

Parameters

parameterName
The parameter name
parameterType
The data type

Return Value

A SQLiteParameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Add Overload List


SQLiteParameterCollection.Add(String, DbType, Int32) Method

Adds a parameter to the collection

public SQLiteParameter Add(
string parameterName,
DbType parameterType,
int parameterSize
);

Parameters

parameterName
The parameter name
parameterType
The data type
parameterSize
The size of the value

Return Value

A SQLiteParameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Add Overload List


SQLiteParameterCollection.Add(String, DbType, Int32, String) Method

Adds a parameter to the collection

public SQLiteParameter Add(
string parameterName,
DbType parameterType,
int parameterSize,
string sourceColumn
);

Parameters

parameterName
The parameter name
parameterType
The data type
parameterSize
The size of the value
sourceColumn
The source column

Return Value

A SQLiteParameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Add Overload List


AddRange Method

SQLite ADO.NET Provider

SQLiteParameterCollection.AddRange Method

Adds an array of parameters to the collection

Overload List

Adds an array of parameters to the collection

public override void AddRange(Array)

Adds an array of parameters to the collection

public void AddRange(SQLiteParameter[])

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.AddRange(Array) Method

Adds an array of parameters to the collection

public override void AddRange(
Array values
);

Parameters

values
The array of parameters to add

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.AddRange Overload List


SQLiteParameterCollection.AddRange(SQLiteParameter) Method

Adds an array of parameters to the collection

public void AddRange(
SQLiteParameter[] values
);

Parameters

values
The array of parameters to add

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.AddRange Overload List


SQLiteParameterCollection.AddWithValue Method

Adds a named/unnamed parameter and its value to the parameter collection.

public SQLiteParameter AddWithValue(
string parameterName,
object value
);

Parameters

parameterName
Name of the parameter, or null to indicate an unnamed parameter
value
The initial value of the parameter

Return Value

Returns the SQLiteParameter object created during the call.

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.Clear Method

Clears the array and resets the collection

public override void Clear();

Implements

IList.Clear

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


Contains Method

SQLite ADO.NET Provider

SQLiteParameterCollection.Contains Method

Determines if the parameter exists in the collection

Overload List

Determines if the parameter exists in the collection

public override bool Contains(object)

Determines if the named parameter exists in the collection

public override bool Contains(string)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.Contains(Object) Method

Determines if the parameter exists in the collection

public override bool Contains(
object value
);

Parameters

value
The SQLiteParameter to check

Return Value

True if the parameter is in the collection

Implements

IList.Contains

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Contains Overload List


SQLiteParameterCollection.Contains(String) Method

Determines if the named parameter exists in the collection

public override bool Contains(
string parameterName
);

Parameters

parameterName
The name of the parameter to check

Return Value

True if the parameter is in the collection

Implements

IDataParameterCollection.Contains

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.Contains Overload List


SQLiteParameterCollection.CopyTo Method

Not implemented

public override void CopyTo(
Array array,
int index
);

Parameters

array
index

Implements

ICollection.CopyTo

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.GetEnumerator Method

Retrieves an enumerator for the collection

public override IEnumerator GetEnumerator();

Return Value

An enumerator for the underlying array

Implements

IEnumerable.GetEnumerator

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


GetParameter Method

SQLite ADO.NET Provider

SQLiteParameterCollection.GetParameter Method

Retrieves a parameter by its index in the collection

Overload List

Retrieves a parameter by its index in the collection

protected override DbParameter GetParameter(int)

Retrieve a parameter by name from the collection

protected override DbParameter GetParameter(string)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.GetParameter(Int32) Method

Retrieves a parameter by its index in the collection

protected override DbParameter GetParameter(
int index
);

Parameters

index
The index of the parameter to retrieve

Return Value

A DbParameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.GetParameter Overload List


SQLiteParameterCollection.GetParameter(String) Method

Retrieve a parameter by name from the collection

protected override DbParameter GetParameter(
string parameterName
);

Parameters

parameterName
The name of the parameter to fetch

Return Value

A DbParameter object

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.GetParameter Overload List


IndexOf Method

SQLite ADO.NET Provider

SQLiteParameterCollection.IndexOf Method

Returns the index of a parameter

Overload List

Returns the index of a parameter

public override int IndexOf(object)

Returns the index of a parameter given its name

public override int IndexOf(string)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.IndexOf(Object) Method

Returns the index of a parameter

public override int IndexOf(
object value
);

Parameters

value
The parameter to find

Return Value

-1 if not found, otherwise a zero-based index of the parameter

Implements

IList.IndexOf

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.IndexOf Overload List


SQLiteParameterCollection.IndexOf(String) Method

Returns the index of a parameter given its name

public override int IndexOf(
string parameterName
);

Parameters

parameterName
The name of the parameter to find

Return Value

-1 if not found, otherwise a zero-based index of the parameter

Implements

IDataParameterCollection.IndexOf

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.IndexOf Overload List


SQLiteParameterCollection.Insert Method

Inserts a parameter into the array at the specified location

public override void Insert(
int index,
object value
);

Parameters

index
The zero-based index to insert the parameter at
value
The parameter to insert

Implements

IList.Insert

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.Remove Method

Removes a parameter from the collection

public override void Remove(
object value
);

Parameters

value
The parameter to remove

Implements

IList.Remove

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


RemoveAt Method

SQLite ADO.NET Provider

SQLiteParameterCollection.RemoveAt Method

Removes a parameter from the collection given its index

Overload List

Removes a parameter from the collection given its index

public override void RemoveAt(int)

Removes a parameter from the collection given its name

public override void RemoveAt(string)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.RemoveAt(Int32) Method

Removes a parameter from the collection given its index

public override void RemoveAt(
int index
);

Parameters

index
The zero-based parameter index to remove

Implements

IList.RemoveAt

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.RemoveAt Overload List


SQLiteParameterCollection.RemoveAt(String) Method

Removes a parameter from the collection given its name

public override void RemoveAt(
string parameterName
);

Parameters

parameterName
The name of the parameter to remove

Implements

IDataParameterCollection.RemoveAt

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.RemoveAt Overload List


SetParameter Method

SQLite ADO.NET Provider

SQLiteParameterCollection.SetParameter Method

Re-assign a parameter at the specified index

Overload List

Re-assign a parameter at the specified index

protected override void SetParameter(int,DbParameter)

Re-assign the named parameter to a new parameter object

protected override void SetParameter(string,DbParameter)

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace


SQLiteParameterCollection.SetParameter(Int32, DbParameter) Method

Re-assign a parameter at the specified index

protected override void SetParameter(
int index,
DbParameter value
);

Parameters

index
The zero-based index of the parameter to replace
value
The new parameter

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.SetParameter Overload List


SQLiteParameterCollection.SetParameter(String, DbParameter) Method

Re-assign the named parameter to a new parameter object

protected override void SetParameter(
string parameterName,
DbParameter value
);

Parameters

parameterName
The name of the parameter to replace
value
The new parameter

See Also

SQLiteParameterCollection Class | System.Data.SQLite Namespace | SQLiteParameterCollection.SetParameter Overload List


SQLiteTraceEventHandler Delegate

Raised when a statement first begins executing on a given connection

public delegate void SQLiteTraceEventHandler(
object sender,
TraceEventArgs e
);

Parameters

sender
The connection executing the statement
e
Event arguments of the trace

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SQLiteTransaction Class

SQLite implementation of DbTransaction.

For a list of all members of this type, see SQLiteTransaction Members .

System.Object
MarshalByRefObject
DbTransaction
SQLiteTransaction

public sealed class SQLiteTransaction : DbTransaction

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

SQLiteTransaction Members | System.Data.SQLite Namespace


SQLiteTransaction Members

SQLiteTransaction overview

Public Instance Properties

Connection | Overloaded. Returns the underlying connection to which this transaction applies.
IsolationLevel | Gets the isolation level of the transaction. SQLite only supports Serializable transactions.

Public Instance Methods

Commit | Commits the current transaction.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from DbTransaction) | Overloaded. Releases the unmanaged resources used by the DbTransaction.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Rollback | Rolls back the active transaction.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Properties

DbConnection Forwards to the local Connection property

Protected Instance Methods

Dispose | Overloaded. Disposes the transaction. If it is currently active, any changes are rolled back.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


SQLiteTransaction Properties

The properties of the SQLiteTransaction class are listed below. For a complete list of SQLiteTransaction class members, see the SQLiteTransaction Members topic.

Public Instance Properties

Connection | Overloaded. Returns the underlying connection to which this transaction applies.
IsolationLevel | Gets the isolation level of the transaction. SQLite only supports Serializable transactions.

Protected Instance Properties

DbConnection Forwards to the local Connection property

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


Connection Property

SQLite ADO.NET Provider

SQLiteTransaction.Connection Property

Returns the underlying connection to which this transaction applies.

new public SQLiteConnection Connection { public get; }

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


DbConnection Property

SQLite ADO.NET Provider

SQLiteTransaction.DbConnection Property

Forwards to the local Connection property

protected override DbConnection DbConnection { protected get; }

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


IsolationLevel Property

SQLite ADO.NET Provider

SQLiteTransaction.IsolationLevel Property

Gets the isolation level of the transaction. SQLite only supports Serializable transactions.

public override IsolationLevel IsolationLevel { public get; }

Implements

IDbTransaction.IsolationLevel

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


SQLiteTransaction Methods

The methods of the SQLiteTransaction class are listed below. For a complete list of SQLiteTransaction class members, see the SQLiteTransaction Members topic.

Public Instance Methods

Commit | Commits the current transaction.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from DbTransaction) | Overloaded. Releases the unmanaged resources used by the DbTransaction.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Rollback | Rolls back the active transaction.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Dispose | Overloaded. Disposes the transaction. If it is currently active, any changes are rolled back.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from MarshalByRefObject) | Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object) | Overloaded. Creates a shallow copy of the current Object.

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


SQLiteTransaction.Commit Method

Commits the current transaction.

public override void Commit();

Implements

IDbTransaction.Commit

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


Dispose Method

SQLite ADO.NET Provider

SQLiteTransaction.Dispose Method

Disposes the transaction. If it is currently active, any changes are rolled back.

Overload List

Inherited from DbTransaction.

public void Dispose()

Disposes the transaction. If it is currently active, any changes are rolled back.

protected override void Dispose(bool)

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


SQLiteTransaction.Dispose(Boolean) Method

Disposes the transaction. If it is currently active, any changes are rolled back.

protected override void Dispose(
bool disposing
);

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace | SQLiteTransaction.Dispose Overload List


SQLiteTransaction.Rollback Method

Rolls back the active transaction.

public override void Rollback();

Implements

IDbTransaction.Rollback

See Also

SQLiteTransaction Class | System.Data.SQLite Namespace


SQLiteUpdateEventHandler Delegate

Raised when data is inserted, updated and deleted on a given connection

public delegate void SQLiteUpdateEventHandler(
object sender,
UpdateEventArgs e
);

Parameters

sender
The connection committing the transaction
e
The event parameters which triggered the event

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


SynchronizationModes Enumeration

The I/O file cache flushing behavior for the connection

public enum SynchronizationModes

Members

Member Name | Description
Normal | Normal file flushing at critical sections of the code
Full | Full file flushing after every write operation
Off | Use the default operating system's file flushing, SQLite does not explicitly flush the file buffers after writing

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


TraceEventArgs Class

Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text

For a list of all members of this type, see TraceEventArgs Members .

System.Object
EventArgs
TraceEventArgs

public class TraceEventArgs : EventArgs

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

TraceEventArgs Members | System.Data.SQLite Namespace


TraceEventArgs Members

TraceEventArgs overview

Public Instance Fields

Statement SQL statement text as the statement first begins executing

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TraceEventArgs Class | System.Data.SQLite Namespace


TraceEventArgs Fields

The fields of the TraceEventArgs class are listed below. For a complete list of TraceEventArgs class members, see the TraceEventArgs Members topic.

Public Instance Fields

Statement SQL statement text as the statement first begins executing

See Also

TraceEventArgs Class | System.Data.SQLite Namespace


TraceEventArgs.Statement Field

SQL statement text as the statement first begins executing

public readonly string Statement;

See Also

TraceEventArgs Class | System.Data.SQLite Namespace


TypeAffinity Enumeration

SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite understands. The DateTime extension to the spec is for internal use only.

public enum TypeAffinity

Members

Member Name | Description
Uninitialized | Not used
Int64 | All integers in SQLite default to Int64
Double | All floating point numbers in SQLite default to double
Text | The default data type of SQLite is text
Blob | Typically blob types are only seen when returned from a function
Null | Null types can be returned from functions
DateTime | Used internally by this provider
None | Used internally

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


UpdateEventArgs Class

Passed during an Update callback, these event arguments detail the type of update operation being performed on the given connection.

For a list of all members of this type, see UpdateEventArgs Members .

System.Object
EventArgs
UpdateEventArgs

public class UpdateEventArgs : EventArgs

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

UpdateEventArgs Members | System.Data.SQLite Namespace


UpdateEventArgs Members

UpdateEventArgs overview

Public Instance Fields

Database | The name of the database being updated (usually "main" but can be any attached or temporary database)
Event | The type of update being performed (insert/update/delete)
RowId | The RowId affected by this update.
Table | The name of the table being updated

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventArgs Fields

The fields of the UpdateEventArgs class are listed below. For a complete list of UpdateEventArgs class members, see the UpdateEventArgs Members topic.

Public Instance Fields

Database | The name of the database being updated (usually "main" but can be any attached or temporary database)
Event | The type of update being performed (insert/update/delete)
RowId | The RowId affected by this update.
Table | The name of the table being updated

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventArgs.Database Field

The name of the database being updated (usually "main" but can be any attached or temporary database)

public readonly string Database;

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventArgs.Event Field

The type of update being performed (insert/update/delete)

public readonly UpdateEventType Event;

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventArgs.RowId Field

The RowId affected by this update.

public readonly long RowId;

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventArgs.Table Field

The name of the table being updated

public readonly string Table;

See Also

UpdateEventArgs Class | System.Data.SQLite Namespace


UpdateEventType Enumeration

Whenever an update event is triggered on a connection, this enum will indicate exactly what type of operation is being performed.

public enum UpdateEventType

Members

Member Name | Description
Delete | A row is being deleted from the given database and table
Insert | A row is being inserted into the table.
Update | A row is being updated in the table.

Requirements

Namespace: System.Data.SQLite

Assembly: System.Data.SQLite (in System.Data.SQLite.dll)

See Also

System.Data.SQLite Namespace


TYPES
SQLite Language Reference Documentation
See Also Example

SQL As Understood By SQLite (sortof)

TYPES

sql-statement ::= | TYPES [datatype name][,datatype name][,datatype name][,...] ; select-stmt
select-stmt ::= | see SELECT

Use the TYPES keyword before a SELECT statement to provide the SQLite ADO.NET provider a list of return datatypes to expect from the subsequent SELECT statement.

This is a language extension (aka hack) to SQLite specifically for the ADO.NET data provider. It is a pseudo-statement, meaning only the ADO.NET provider understands it.

Background

Due to SQLite's typeless nature, there are certain kinds of queries for which the ADO.NET provider cannot determine the proper return data type. Scalar and aggregate functions pose a particular problem because there is no requirement for a given scalar or aggregate function to return any particular datatype. As a matter of fact, scalar functions could theoretically return a different datatype for every row or column in a query and this is perfectly legal from SQLite's point of view.

Since ADO.NET is designed around a typed system and we're shoe-horning SQLite into it, this keyword helps the provider out in cases where the return type cannot be easily determined.

This command must be used in conjunction with a SELECT statement. It only works when both the TYPES keyword and its value(s) are passed along with a SELECT statement as a single semi-colon separated unit.

Examples

TYPES [bigint], [int], [smallint], [tinyint];
SELECT 1, 2, 3, 4;

The above query would return the columns as types System.Int64, System.Int32, System.Int16 and System.Byte respectively.

TYPES [bigint], [int], , [tinyint];
SELECT 1, 2, 3, 4;

In this sample, only columns 1, 2 and 4 would have explicit typing. Column 3's datatype would pass though the system and be discovered normally.

TYPES real;
SELECT SUM(Cost) FROM [Products];

The above query explicitly tells the provider that the SUM aggregate function returns a System.Double.

Usage Notes

  • You cannot use parameters in the TYPES statement.
  • The TYPES statement must be immediately followed by a SELECT statement.
  • It is legal to pass multiple TYPES and SELECT statements in a multi-statement command.
  • You may enclose datatypes in quotes "" or brackets [] or those `` thingies if you want.


System.Data.SQLiteHierarchy

SQLite ADO.NET Provider

System.Data.SQLite Hierarchy

Object
Attribute
SQLiteFunctionAttribute
DbConnectionStringBuilder ---- ICollection, IDictionary, IEnumerable, ICustomTypeDescriptor
SQLiteConnectionStringBuilder
DbProviderFactory
SQLiteFactory ---- IDisposable, IServiceProvider
ISQLiteConnectionPool
SQLiteConvert
SQLiteFunction ---- IDisposable
SQLiteFunctionEx
SQLiteLog
SQLiteMetaDataCollectionNames
Delegate ---- ICloneable, ISerializable
MulticastDelegate
SQLiteBackupCallback
SQLiteCommitHandler
SQLiteConnectionEventHandler
SQLiteLogEventHandler
SQLiteTraceEventHandler
SQLiteUpdateEventHandler
EventArgs
CommitEventArgs
ConnectionEventArgs
LogEventArgs
TraceEventArgs
UpdateEventArgs
Exception ---- ISerializable
SystemException
ExternalException
DbException
SQLiteException
MarshalByRefObject
Component ---- IComponent, IDisposable
DataAdapter ---- IDataAdapter
DbDataAdapter ---- IDbDataAdapter, ICloneable
SQLiteDataAdapter
DbCommand ---- IDbCommand
SQLiteCommand ---- ICloneable
DbCommandBuilder
SQLiteCommandBuilder
DbConnection ---- IDbConnection
SQLiteConnection ---- ICloneable
DbDataReader ---- IEnumerable, IDataReader, IDataRecord, IDisposable
SQLiteDataReader
DbParameter ---- IDataParameter, IDbDataParameter
SQLiteParameter ---- ICloneable
DbParameterCollection ---- ICollection, IEnumerable, IList, IDataParameterCollection
SQLiteParameterCollection
DbTransaction ---- IDbTransaction, IDisposable
SQLiteTransaction
ValueType
CollationSequence
Enum ---- IComparable, IConvertible, IFormattable
CollationEncodingEnum
CollationTypeEnum
FunctionType
SQLiteConnectionEventType
SQLiteConnectionFlags
SQLiteDateFormats
SQLiteErrorCode
SQLiteExecuteType
SQLiteJournalModeEnum
SynchronizationModes
TypeAffinity
UpdateEventType

See Also

System.Data.SQLite Namespace