Cocon90.Db.Sqlite
1.1.4
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.0
This package targets .NET Framework 4.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Cocon90.Db.Sqlite --version 1.1.4
NuGet\Install-Package Cocon90.Db.Sqlite -Version 1.1.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cocon90.Db.Sqlite" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cocon90.Db.Sqlite --version 1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cocon90.Db.Sqlite, 1.1.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Cocon90.Db.Sqlite as a Cake Addin #addin nuget:?package=Cocon90.Db.Sqlite&version=1.1.4 // Install Cocon90.Db.Sqlite as a Cake Tool #tool nuget:?package=Cocon90.Db.Sqlite&version=1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
新建Program类,加入Main函数,比如我们要操作Sqlite数据库加入下列代码:
static void Main(string[] args)
{
// 依次传入数据库类型,连接字符串来构建操作对像(此方法不会连接数据库,可以提前实例好)。
var dh = Cocon90.Db.Common.Db.GetDataHelper("Sqlite", "Data Source=${app}\\mysqlite.db;");
// 或者也可以直接通过读取app.config或者web.config或者.NetCore中的appsettings.json来读取连接字符串。
var dh = Cocon90.Db.Common.Db.GetDataHelper();
//通过实体(下方有实体的例子),执行创建数据表
var effRow = dh.CreateOrUpdateTable<Model.CountryLanguageModel>();
//...
var tab = dh.GetTable("select * from Student");
var eff = dh.ExecNoQuery("...");
var str = dh.GetString("...");
var isok = dh.GetBoolean("...");
var age = dh.GetInt("...");
var mylst = dh.GetListString("...");
var pr = dh.GetPagedResult("...");
}
在NetFramework中,如果在要读取配置文件中的app.config中的连接语句,则需要在App.config中进行如下配置:
<configuration>
<connectionStrings>
<add name="dbConnString" providerName="Sqlite" connectionString="Data Source=${app}\SQLiteSpy.db3;"/>
</connectionStrings>
</configuration>
在NetCore或者其它NetStandard中如果在要读取配置文件中的appsettings.json中的连接语句,则需要在appsettings.json中进行如下配置:
{
"dbType": "SqlServer",
"dbConnString": "Server=.;Database=world;Uid=sa;Pwd=123456;"
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETStandard 2.0
- Cocon90.Db.Common (>= 1.1.4)
- Microsoft.Data.SQLite (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Cocon90.Db是由Cocon90.Db.Common为核心的类库与其它数据库操作库组合而成,以方便调用为主要目的,支持ORM操作,增、删、改、查、事务、批量执行、创建表、插入或保存记录 等等,并提供多种数据库支持。当前已支持Mysql、Sqlite、SqlServer。