SharpSeries 0.1.4

dotnet add package SharpSeries --version 0.1.4
                    
NuGet\Install-Package SharpSeries -Version 0.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="SharpSeries" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpSeries" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="SharpSeries" />
                    
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 SharpSeries --version 0.1.4
                    
#r "nuget: SharpSeries, 0.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.
#:package SharpSeries@0.1.4
                    
#: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=SharpSeries&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=SharpSeries&version=0.1.4
                    
Install as a Cake Tool

SharpSeries

Build & Test Publish to NuGet NuGet License: IPL-1.0

A pure C# ADO.NET data provider for IBM i Db2 (AS/400, System i).

SharpSeries implements the DRDA wire protocol directly in managed C# — no proprietary IBM client libraries, no native dependencies, no client access licenses required. It works on any platform .NET runs on.

Features

  • Pure managed C# — no IBM client software or native dependencies
  • Full ADO.NET implementationDbConnection, DbCommand, DbDataReader, DbTransaction, DbParameter
  • DRDA wire protocol — native implementation of the Distributed Relational Database Architecture protocol
  • Connection pooling — built-in connection pool for high-throughput workloads
  • Transaction support — explicit commit/rollback with automatic auto-commit for standalone statements
  • EBCDIC/CCSID support — configurable character set conversion for international IBM i systems
  • SQL & System naming — supports both SCHEMA.TABLE and LIBRARY/FILE naming conventions
  • Async & sync APIs — full async/await support alongside synchronous methods

Quick Start

Install the NuGet package

dotnet add package SharpSeries

Connect and query

using SharpSeries.Data;

string connString = "Server=10.0.0.5;User ID=myuser;Password=mypass;";

using var connection = new Db2Connection(connString);
await connection.OpenAsync();

using var command = connection.CreateCommand();
command.CommandText = "SELECT * FROM QSYS2.SYSTABLES FETCH FIRST 10 ROWS ONLY";

using var reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
    Console.WriteLine(reader["TABLE_NAME"]);
}

ExecuteNonQuery — INSERT, UPDATE, DELETE

using var cmd = connection.CreateCommand();
cmd.CommandText = "UPDATE MYLIB.CUSTOMERS SET STATUS = 'ACTIVE' WHERE ID = 123";
int rows = cmd.ExecuteNonQuery();

Transactions

using var tx = connection.BeginTransaction();
try
{
    using var cmd1 = connection.CreateCommand();
    cmd1.Transaction = tx;
    cmd1.CommandText = "INSERT INTO MYLIB.ORDERS (ITEM) VALUES ('Widget')";
    cmd1.ExecuteNonQuery();

    using var cmd2 = connection.CreateCommand();
    cmd2.Transaction = tx;
    cmd2.CommandText = "UPDATE MYLIB.INVENTORY SET QTY = QTY - 1 WHERE ITEM = 'Widget'";
    cmd2.ExecuteNonQuery();

    tx.Commit();
}
catch
{
    tx.Rollback();
    throw;
}

Connection Strings

Parameter Description Default
Server Hostname or IP of the IBM i system (required)
User ID IBM i user profile (required)
Password IBM i password (required)
Database RDB name (system name) (empty)
Naming SQL (schema.table) or System (library/file) SQL
CCSID EBCDIC character set identifier 37 (US English)
Read Only true to prevent write operations false
Server=192.168.1.100;User ID=MYUSER;Password=MYPASS;Naming=SQL;

Architecture

SharpSeries/
├── Data/              # ADO.NET provider implementation
│   ├── Db2Connection
│   ├── Db2Command
│   ├── Db2DataReader
│   ├── Db2Parameter
│   ├── Db2Transaction
│   └── Db2ProviderFactory
├── HostServer/        # DRDA host server communication
│   ├── HostServerConnectionManager
│   ├── QueryExecutor
│   └── QueryResult
├── Network/           # Network stream handling
├── Security/          # DES password encryption
├── Encoding/          # CCSID/EBCDIC conversion
├── Types/             # Db2 type converters (DateTime, Decimal, String)
├── Pool/              # Connection pooling
└── Logging/           # Built-in diagnostics logger

Logging

SharpSeries includes a built-in logger for diagnostics:

using SharpSeries.Logging;

Db2Logger.Level = Db2LogLevel.Trace;
Db2Logger.LogAction = (level, message) => Console.WriteLine($"[{level}] {message}");

Requirements

  • .NET 10.0+
  • IBM i system with DRDA host server accessible (port 449 for server mapper, typically port 8471 for the database host server)

Documentation

See the User Guide for detailed documentation on connection strings, transactions, naming conventions, CCSID configuration, and more.

Samples

Two sample applications are included:

  • SampleIseriesReader — connects and runs a configurable SELECT query
  • SampleIseriesWriter — demonstrates CREATE TABLE → INSERT → SELECT → DROP TABLE

Both use a .env file for credentials:

DB2_SYSTEM=as400.example.com
DB2_USER=MYUSER
DB2_PASSWORD=MYPASSWORD

Building from Source

git clone https://github.com/tomdertechie/SharpSeries.git
cd SharpSeries
dotnet build
dotnet test

License

This project is licensed under the IBM Public License Version 1.0.

Portions of this software are derivative works of JTOpen, the IBM Toolbox for Java.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

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
0.1.4 168 4/14/2026
0.1.3 141 4/14/2026
0.1.2 138 4/14/2026

Initial release