SqlFlow.SqlServer 1.0.1

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

SqlFlow

SqlFlow is a lightweight SQL Server helper library for .NET Framework applications. It is designed for developers who want full control over SQL without using ORMs.

SqlFlow focuses on simplicity, clarity, and classic ADO.NET patterns.

Target Framework:

  • .NET Framework 4.7.2
  • Best suited for WinForms and WPF applications

Installation: Install SqlFlow from NuGet using: Install-Package SqlFlow.SqlServer

Create Agent: Create one Agent instance and reuse it across your application.

var agent = new Agent( "localhost", "TestDb", new ConnectionOptions(), new AgentOptions());

agent.Error += Agent_Error;

Check Database Connection: Use this to verify database connectivity.

bool ok = agent.CheckConnection(); if (!ok) { MessageBox.Show("Cannot connect to database."); }

Query (DataTable): Execute a SELECT query and get a DataTable.

DataTable dt = agent.Query( "SELECT * FROM usr_Users WHERE Id = @Id", new SqlParameter("@Id", 1));

Query Single Value: Retrieve a single column value from a query result.

object username = agent.Query( "SELECT Username FROM usr_Users WHERE Id = @Id", "Username", new SqlParameter("@Id", 1));

Returns the value of the specified column. Returns null if no rows are found.

Execute (INSERT / UPDATE / DELETE): Execute a non-query command.

int rows = agent.Execute( "UPDATE usr_Users SET Username = @U WHERE Id = @Id", new SqlParameter("@U", "TestUser"), new SqlParameter("@Id", 1));

Returns the number of affected rows.

Insert and Get New ID: Insert a record and retrieve the newly generated IDENTITY value.

int newId = agent.ExecuteInsertId( "INSERT INTO usr_Users (Username) OUTPUT INSERTED.Id VALUES (@U)", new SqlParameter("@U", "TestUser"));

Error Handling (WinForms Example): SqlFlow exposes a single error event with error classification.

private void Agent_Error(object sender, SqlFlowErrorEventArgs e) { switch (e.ErrorType) { case SqlFlowErrorType.Timeout: MessageBox.Show("Database timeout."); break;

    case SqlFlowErrorType.DuplicateKey:
        MessageBox.Show("Duplicate record.");
        break;

    case SqlFlowErrorType.ForeignKeyViolation:
        MessageBox.Show("Foreign key violation.");
        break;

    case SqlFlowErrorType.LoginFailed:
        MessageBox.Show("Database login failed.");
        break;

    default:
        MessageBox.Show(e.Exception.Message);
        break;
}

}

Features:

  • Simple Query and Execute API
  • SQL parameter validation
  • Insert-and-return-ID helper
  • Error classification
  • Centralized error event
  • No ORM, no magic
  • Designed for classic .NET applications

Design Philosophy:

  • Explicit SQL
  • Predictable behavior
  • No hidden retries
  • No abstraction layers
  • Easy to debug and maintain

Author: Zacharias Travagiakis

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • 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
1.0.1 194 12/22/2025
1.0.0 191 12/22/2025

Initial release.
   Includes Query, Execute, InsertAndGetId, error classification, and CheckConnection.