MeDB.NetCoreConnector
10.1.8028
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 MeDB.NetCoreConnector --version 10.1.8028
NuGet\Install-Package MeDB.NetCoreConnector -Version 10.1.8028
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="MeDB.NetCoreConnector" Version="10.1.8028" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MeDB.NetCoreConnector --version 10.1.8028
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MeDB.NetCoreConnector, 10.1.8028"
#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 MeDB.NetCoreConnector as a Cake Addin #addin nuget:?package=MeDB.NetCoreConnector&version=10.1.8028 // Install MeDB.NetCoreConnector as a Cake Tool #tool nuget:?package=MeDB.NetCoreConnector&version=10.1.8028
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
关于 MeDbConnector
MeDB.NetCoreConnector 是为访问MeDB数据库的net6,net8提供的驱动程序集,并专为 NXDO.Data 数据支持器对象连接进行了优化,部分认证与优化代码被集成在 NXDO.Data 中,非 ‘中船.11所(csss.11所)’ 的开发人员请谨慎使用本程序。
采用C#开发的 ADO.NET 驱动, 支持如下 MeDB, MySQL, MariaDB, Amazon Aurora, Azure Database for MySQL 和其它基于MySQL衍生的数据库.
主要特点
- 完全支持异步I/O
- 高性能
- 支持 .NET 6.0,8.0,java
异步示例
// 设置数据库连接信息
var builder = new MeDbConnectionStringBuilder
{
Server = "机器名或IP地址",
UserID = "用户名",
Password = "密码",
Database = "数据库名称",
};
// 异步打开连接
using var conn = new MeDbConnection(builder.ConnectionString);
await conn.OpenAsync();
// 创建command对象设置SQL语句及其参数
using var cmd = conn.CreateCommand();
cmd.CommandText = @"SELECT * FROM Com_611SB WHERE job_no = @JobNo;";
cmd.Parameters.AddWithValue("@JobNo", 1385);
// 异步执行读取命令
using var reader = await cmd.ExecuteReaderAsync();
while (reader.Read())
{
var id = reader.GetInt32("job_id");
var date = reader.GetDateTime("write_date");
// ...
}
ASP.NETCore
对于ASP.NETCore, 使用包 MeDB.WebDI 以便使用依赖项注入和日志集成,相关示例请转至依赖包查看。
NXDO.Data 的配置
鉴于 NXDO.Data 作者内置实体映射,意在规避其单位内部开发人员对特定程序集的依赖,仅提供注入方式在内部提供优化。
//配置项自动注入 nxdo.data
"providerName": "MeDB.NetCoreConnector",
"providerAssemblyFileName": "MeDB.MeDBConnector.MeDbConnectorFactory, MeDB.NetCoreConnector.dll",
"providerAssemblyQualifiedName": "MeDB.MeDBConnector.MeDbConnectorFactory, MeDB.NetCoreConnector, Version=10.0.8028.0, Culture=neutral, PublicKeyToken=a3a15b70fe786e3e",
"dbType": "MeDbDbType",
"connectionString": "server=localhost;port=端口;database=数据库名称;user id=用户;password=密码;allowuservariables=True;characterset=utf8;Pooling=false;",
//1:手工注入 nxdo.data
var providerName = "MeDB.NetCoreConnector";
var providerAssemblyFileName = "MeDB.MeDBConnector.MeDbConnectorFactory, MeDB.NetCoreConnector.dll";
NXDO.Data.DbClient.AnyDbProviderFactoryRegister.Add(providerName, providerAssemblyFileName);
//2:手工注入 nxdo.data
var providerAssemblyQualifiedName = "MeDB.MeDBConnector.MeDbConnectorFactory, MeDB.NetCoreConnector, Version=10.0.8028.0, Culture=neutral, PublicKeyToken=a3a15b70fe786e3e";
NXDO.Data.DbClient.AnyDbProviderFactoryRegister.Add(providerName, providerAssemblyQualifiedName);
主要类型
此库提供的主要类型有:
MeDbConnection
(实现了DbConnection
)MeDbCommand
(实现了DbCommand
)MeDbDataReader
(实现了DbDataReader
)MeDbConnectionStringBuilder
MeDbConnectorFactory
MeDbDataAdapter
MeDbException
MeDbTransaction
(实现了DbTransaction
)
相关程序包
- 依赖注入 MeDB.WebDI
- 数据实体 NXDO.Data
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 is compatible. 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. net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- System.Diagnostics.DiagnosticSource (>= 7.0.2)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- System.Diagnostics.DiagnosticSource (>= 9.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MeDB.NetCoreConnector:
Package | Downloads |
---|---|
MeDB.WebDI
MeDB.WebDI-V10 (Asp.NetCore DependencyInjection) |
GitHub repositories
This package is not used by any popular GitHub repositories.