PWMIS.SOD.Kingbase.Provider.Net6V9 6.0.1

dotnet add package PWMIS.SOD.Kingbase.Provider.Net6V9 --version 6.0.1
                    
NuGet\Install-Package PWMIS.SOD.Kingbase.Provider.Net6V9 -Version 6.0.1
                    
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.Net6V9" Version="6.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PWMIS.SOD.Kingbase.Provider.Net6V9" Version="6.0.1" />
                    
Directory.Packages.props
<PackageReference Include="PWMIS.SOD.Kingbase.Provider.Net6V9" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PWMIS.SOD.Kingbase.Provider.Net6V9 --version 6.0.1
                    
#r "nuget: PWMIS.SOD.Kingbase.Provider.Net6V9, 6.0.1"
                    
#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.
#:package PWMIS.SOD.Kingbase.Provider.Net6V9@6.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PWMIS.SOD.Kingbase.Provider.Net6V9&version=6.0.1
                    
Install as a Cake Addin
#tool nuget:?package=PWMIS.SOD.Kingbase.Provider.Net6V9&version=6.0.1
                    
Install as a Cake Tool

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 --人大金仓,使用可访问金仓V8以及V9数据库的通用驱动程序。

  • PWMIS.SOD.Kingbase.Provider.Net6V9 --电科金仓,使用可访问金仓V9数据库的官方指定的可适用于.NET6的驱动程序

  • PWMIS.SOD.Kingbase.Provider.Net8V9 --电科金仓,使用可访问金仓V9数据库的官方指定的可适用于.NET8的驱动程序

关于金仓的驱动程序

人大金仓现在以及更名为电科金仓,其数据库一直在迭代和发展之中,某些版本特别是金仓为客户定制的版本在某些细节上有所区别,所以SOD框架封装了使用金仓不同驱动程序的SOD数据提供程序,这些数据提供程序的区别仅仅在于使用的金仓驱动程序不同,大家可以根据实际情况测试选用。 SOD封装的金仓数据提供程序均支持设置数据库兼容模式,例如设置兼容Oracle,MySQL,SQL Server,设置兼容模式主要是为了适应兼容的数据库所使用的语法,例如Oracle使用双引号,MySQL使用反单引号,而SqlServer使用中括号。

下面是使用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;
     localDb.DataBaseMode = "MySQL"; //设置数据库兼容模式
     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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.1 69 7/5/2025
6.0.0 65 7/5/2025

使用官方指定的驱动程序封装,用于访问金仓V9版本的数据库或者V8某些定制版本的数据库。
支持设置数据库兼容模式。