Quick Start Guide
NTi was built to solve a problem few tools tackle: connecting your IBM i to .NET and being up and running in under 15 minutes.
No disruption to your workflow, no training required, no complex setup. Everything plugs directly into Visual Studio with a single NuGet reference. You write standard C# with a familiar syntax, no RPG knowledge required, no steep learning curve.
NTi is also fully cross-platform - Windows, Linux, and macOS - and works with any IBM i version.
That's it. Just code.
Prerequisites
Development side
- Visual Studio 2022, JetBrains Rider, or VS Code with the C# extension
- A compatible .NET version:
- .NET 6 / 7 / 8 / 9 / 10
- .NET Standard 2.1
- .NET Core 3.1
- .NET Framework 4.7 and later
IBM i side
- IBM i V5R4 or later
- TCP services
*DATABASE,*RMTCMD, and*SIGNONstarted - An active NTi license - Start your free trial
💡 For the complete prerequisites and license installation steps, see the Installation page.
Step 1 - Install NTi via NuGet
Open a terminal in your project folder and add the packages:
dotnet add package Aumerial.Data.Nti
dotnet add package Dapper
Or via the Visual Studio Package Manager Console:
Install-Package Aumerial.Data.Nti
Install-Package Dapper
💡 Why Dapper? Dapper is a lightweight micro-ORM that automatically maps SQL results to your C# objects. It extends your NTi connection with intuitive methods like
Query<T>andExecute, making data access clean and natural.
Step 2 - Open a connection
using Aumerial.Data.Nti;
using Dapper;
using var conn = new NTiConnection("server=serverName;user=userName;password=password");
conn.Open();
Console.WriteLine(conn.State == ConnectionState.Open
? "✅ IBM i connection and NTi license OK."
: "❌ Connection failed.");
💡 The connection string supports many advanced options: SSL/TLS, connection pooling, MFA, default library, and more. See the Connection page for the full reference.
Step 3 - Read data
public class MyRecord
{
public string Id { get; set; }
public string Label { get; set; }
}
var records = conn.Query("SELECT * FROM MYLIB.MYTABLE");Step 4 - Write data
conn.Execute(@"
UPDATE MYLIB.MYTABLE
SET LABEL = 'Updated'
WHERE ID = 'REC-001'
");
💡 For a complete example using Entity Framework Core (Code First, DB First, CRUD), see the CRUD with EF Core 8 tutorial.
Step 5 - Access all IBM i resources
NTi goes far beyond SQL. From your C# code, you have access to the full range of IBM i resources.
Execute a CL command
try
{
conn.ExecuteClCommand("CRLIB LIB(MYLIB) TEXT('My new library')");
}
catch (NTiException ex)
{
Console.WriteLine(ex.Message);
}
💡 See the Execute a CL command tutorial.
Call an RPG program
var parms = new List
{
new NTiProgramParameter("Hello", 10).AsInput(), // CHAR(10) INPUT
new NTiProgramParameter("", 128).AsOutput() // CHAR(128) OUTPUT
};
conn.CallProgram("MYLIB", "MYPGM", parms);
string result = parms[1].GetString(0, 128);
💡 See the Call a program tutorial for a complete example with input parameters and return values.
Call a stored procedure
var parameters = new DynamicParameters();
parameters.Add("myParam", dbType: DbType.Decimal, direction: ParameterDirection.Output);
var records = (await conn.QueryAsync(
"MYLIB.MYPROC",
parameters,
commandType: CommandType.StoredProcedure
)).ToList();
💡 See the Stored procedure tutorial for a complete example using both the DataReader and Dapper approaches.
What's next?
You're up and running. Here are a few pages to go further:
- Connection - connection string, pooling, MFA
- Entity Framework Core - Code First and DB First ORM on DB2 for i
- Toolbox - spool files, CL commands, jobs, and system values