添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
帅气的灭火器  ·  Database re-creation ...·  3 月前    · 
儒雅的甘蔗  ·  SQLite error no such ...·  3 月前    · 
发财的移动电源  ·  Urbackup Server ...·  3 月前    · 
聪明伶俐的馒头  ·  Urbackup Server ...·  3 月前    · 
强悍的毛豆  ·  Python SQLite - ...·  2 月前    · 
八块腹肌的酱牛肉  ·  Search Page 1/15: ...·  1 月前    · 
威武的菠菜  ·  metc治疗效果_39健康网·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Microsoft.Data.Sqlite is a lightweight ADO.NET provider for SQLite. The Entity Framework Core provider for SQLite is built on top of this library. However, it can also be used independently or with other data access libraries.

Installation

The latest stable version is available on NuGet .

.NET Core CLI Visual Studio

Usage

This library implements the common ADO.NET abstractions for connections, commands, data readers, and so on.

using (var connection = new SqliteConnection("Data Source=hello.db"))
    connection.Open();
    var command = connection.CreateCommand();
    command.CommandText =
        SELECT name
        FROM user
        WHERE id = $id
    command.Parameters.AddWithValue("$id", id);
    using (var reader = command.ExecuteReader())
        while (reader.Read())
            var name = reader.GetString(0);
            Console.WriteLine($"Hello, {name}!");

You can see the full code for this example at HelloWorldSample.

See also

  • Connection strings
  • API Reference
  • SQL Syntax
  •