PWMIS.SOD.Kingbase.Provider 6.0.5

dotnet add package PWMIS.SOD.Kingbase.Provider --version 6.0.5                
NuGet\Install-Package PWMIS.SOD.Kingbase.Provider -Version 6.0.5                
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="PWMIS.SOD.Kingbase.Provider" Version="6.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PWMIS.SOD.Kingbase.Provider --version 6.0.5                
#r "nuget: PWMIS.SOD.Kingbase.Provider, 6.0.5"                
#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 PWMIS.SOD.Kingbase.Provider as a Cake Addin
#addin nuget:?package=PWMIS.SOD.Kingbase.Provider&version=6.0.5

// Install PWMIS.SOD.Kingbase.Provider as a Cake Tool
#tool nuget:?package=PWMIS.SOD.Kingbase.Provider&version=6.0.5                

SOD框架国产化支持 说明


SOD早期版本

SOD框架在多年前就已经支持国产数据库人大金仓和达梦,对应的源码解决方案程序集项目为:

  • PWMIS.DataProvider.Data.Dameng -- 达梦

  • PWMIS.DataProvider.Data.Kingbase --人大金仓

对应的Nuget程序包ID为:

SOD6.0版本

2024年5月SOD框架程序集全面采用 .NET6.0为目标框架,对国产化的支持更好,完全兼容SOD的分页和自增表方案,并且通过了项目验证,可以放心使用。 对应的程序包ID为:

  • PWMIS.SOD.DaMeng.Provider --达梦

  • PWMIS.SOD.Kingbase.Provider --人大金仓

下面是使用SOD达梦和金仓提供程序的示例代码。

达梦数据库测试代码:

       static void Main(string[] args)
        {
            Console.WriteLine("Hello, SOD6!");
            //自增表测试,参考官方技术文档 https://eco.dameng.com/document/dm/zh-cn/faq/faq-sql-gramm.html
            //如果需要创建表,请取消下一个代码中的注释
            string createTable = @"
            CREATE TABLE new_employees1
            (
                id_num int IDENTITY(1,1),
                fname varchar (20),
                 minit char(1),
                 lname varchar(30)
            );";
            var helper = AdoHelper.CreateHelper("local");
            //helper.ExecuteNonQuery(createTable);
       
            //查询插入的自增值必须跟插入语句在同一个连接会话中
            helper.OpenSession();
            string sql_insert = "insert into new_employees1(fname,minit,lname) values('test','d','test1');";
            helper.ExecuteNonQuery(sql_insert);
            string sql_lastid = "select @@IDENTITY";
            long lastInsertedId=(long)helper.ExecuteScalar(sql_lastid);
            Console.WriteLine("插入记录,自增标识列[ID]={0}", lastInsertedId);
            helper.CloseSession();
            //自增表测试完成
       
            SimpleEntity entity = new SimpleEntity();
            entity.Name = "Test_" + DateTime.Now.ToString("yyyyMMddHHmmss");
            entity.AtTime = DateTime.Now;
            LocalDbContext ctx = new LocalDbContext();
            ctx.Add(entity);
            var localDb = (Dameng)ctx.CurrentDataBase;
            var cb = localDb.ConnectionStringBuilder;
            Console.WriteLine("Dameng(达梦) Add Entity Data OK! Database User ID={0},\r\n " +
                "Inserted Entity Identity Field value={1}", localDb.ConnectionUserID, entity.ID);
       
            //查询前10条数据
            var list= OQL.From<SimpleEntity>().Limit(10,1).ToList();
            //使用接口类型查询
            //SimpleEntity 映射的表名称和类型名称不一致,所以下面的查询需要指定表名称
            string tableName = entity.GetTableName();
            var list2 = OQL.FromObject<ISimple>(tableName)
                .Select()
                .OrderBy((o,entity)=>o.Asc(entity.ID)) //ISimple 动态创建的实体类没有指定主键信息,分页前需要指定排序字段
                .Limit(10, 1)
                .ToList();
       
            Console.WriteLine("Data record count={0}", list.Count);
            Console.Read();
        }

更详细的内容请参考项目解决方案的源码,对应位置:

\sod\src\SOD.NET6\OtherProvider\PWMIS.DataProvider.Data.Dameng

下面是金仓数据库测试代码:

 static void Main(string[] args)
 {
     Console.WriteLine("Hello, SOD6!");
     SimpleEntity entity = new SimpleEntity();
     entity.Name = "Test_"+DateTime.Now.ToString("yyyyMMddHHmmss");
     entity.AtTime = DateTime.Now;
     LocalDbContext ctx = new LocalDbContext();
     ctx.Add(entity);
     var localDb = (Kingbase)ctx.CurrentDataBase;
     var cb = localDb.ConnectionStringBuilder;
     Console.WriteLine("Kingbase Add Entity Data OK! Database User ID={0},\r\n " +
         "Inserted Entity Identity Field value={1}", localDb.ConnectionUserID,entity.ID);
     Console.Read();
 }

更详细的内容请参考项目解决方案的源码,对应位置:

\sod\src\SOD.NET6\OtherProvider\PWMIS.DataProvider.Data.Kingbase

SOD各版本Nuget包说明

PDF.NET.SOD 框架支持 .NET 6.0及以上目标版本的 程序包

  • 注意: 如果需要在 .NET4.7/.NET4.8/.NET Core 2x、3x/.NET 5 使用SOD框架,则需要使用SOD的.NET Standard 2.0目标版本,对应的Nuget包版本为: PDF.NET.SOD 7.0

  • 如果仅需要支持.NET2.0/.NET3.x/.NET4.x的目标版本,对应的Nuget包版本为: PDF.NET.SOD 6.x 以及之下的版本

  • 如果需要支持.NET 6.0/7.0/8.0以及之上的目标版本,对应的Nuget包版本为: PWMIS.SOD.6.0以及之上的版本


深蓝医生

2024-5-17

Product 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.5 78 9/18/2024
6.0.3 110 5/29/2024
6.0.2 99 5/20/2024
6.0.1 106 5/20/2024
6.0.0 89 5/18/2024