Microsoft.Data.Sqlite is a lightweight ADO.NET provider for SQLite. Commonly Used Types: Microsoft.Data.Sqlite.SqliteCommand Microsoft.Data.Sqlite.SqliteConnection Microsoft.Data.Sqlite.SqliteConnectionStringBuilder Microsoft.Data.Sqlite.SqliteDataReader Microsoft.Data.Sqlite.SqliteException Microsoft.Data.Sqlite.SqliteFactory Microsoft.Data.Sqlite.SqliteParameter Microsoft.Data.Sqlite.SqliteTransaction
$ dotnet add package Microsoft.Data.SqliteMicrosoft.Data.Sqlite is a lightweight ADO.NET provider for SQLite. The EF Core provider for SQLite is built on top of this library. However, it can also be used independently or with other data access libraries.
The latest stable version is available on NuGet.
dotnet add package Microsoft.Data.Sqlite
Use the --version option to specify a preview version to install.
This library implements the common ADO.NET abstractions for connections, commands, data readers, and so on. For more information, see Microsoft.Data.Sqlite on Microsoft Docs.
using var connection = new SqliteConnection("Data Source=Blogs.db");
connection.Open();
using var command = connection.CreateCommand();
command.CommandText = "SELECT Url FROM Blogs";
using var reader = command.ExecuteReader();
while (reader.Read())
{
var url = reader.GetString(0);
}
If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an issue. For more details, see getting support.