SQLStoredProcedureCommandsFunctions 1.0.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package SQLStoredProcedureCommandsFunctions --version 1.0.0.7
                    
NuGet\Install-Package SQLStoredProcedureCommandsFunctions -Version 1.0.0.7
                    
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="SQLStoredProcedureCommandsFunctions" Version="1.0.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SQLStoredProcedureCommandsFunctions" Version="1.0.0.7" />
                    
Directory.Packages.props
<PackageReference Include="SQLStoredProcedureCommandsFunctions" />
                    
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 SQLStoredProcedureCommandsFunctions --version 1.0.0.7
                    
#r "nuget: SQLStoredProcedureCommandsFunctions, 1.0.0.7"
                    
#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 SQLStoredProcedureCommandsFunctions@1.0.0.7
                    
#: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=SQLStoredProcedureCommandsFunctions&version=1.0.0.7
                    
Install as a Cake Addin
#tool nuget:?package=SQLStoredProcedureCommandsFunctions&version=1.0.0.7
                    
Install as a Cake Tool

SQLStoredProcedureCommandsFunctions 1.0.0.7

A lightweight, high-performance data access helper library for .NET applications that work extensively with SQL Server stored procedures.
This package provides utilities for executing stored procedures, mapping parameters, converting datasets, handling transactions, and simplifying ADO.NET operations.


🚀 Features

🔹 Stored Procedure Execution (Sync + Async)

  • Execute NonQuery, Scalar, Reader, Dataset, and XmlReader
  • Supports:
    • Raw SQL queries
    • Stored procedures
    • Parameter arrays
    • Strongly-typed objects (auto-mapped)

🔹 Automatic SQL Parameter Discovery & Caching

  • Discovers stored procedure parameters using SqlCommandBuilder.DeriveParameters
  • Caches parameter sets for reuse
  • Enhances performance by avoiding repeated metadata calls

🔹 Object → SQL Parameter Mapping

Using SQLParamHelper:

  • Automatically map object properties to SQL parameters
  • [IgnoreDbParameter] attribute allows skipping properties
  • Supports major SQL data types (int, long, string, DateTime, bool, decimal, GUID, etc.)

🔹 Transaction Support

  • Initialize, commit, and rollback transactions easily
  • Works with shared connections
  • Safe handling of transactional state

🔹 DataSet & DataTable Conversion Utilities

  • Convert:
    • DataTable → List<T>
    • DataTable → IEnumerable<T>
    • DataTable → Dictionary
    • List<T> → DataTable
    • Multiple lists → DataSet
  • Includes helpers for moving/shifting columns

🔹 DataTable Extensions

Use DataTableExtensions to:

  • Move columns to specific indices
  • Merge or reorder columns safely
  • Extract column names dynamically

📦 Installation

Install via NuGet:

dotnet add package SQLStoredProcedureCommandsFunctions --version 1.0.0.7
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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Release Notes - v1.0.0.7

✨ Key Features
1. High-Performance Stored Procedure Execution

Execute NonQuery, Scalar, Reader, Dataset, XmlReader operations.

Full support for sync and async methods.

Overloads for:

Raw SQL commands

Stored procedure name

Parameter arrays

Strongly-typed object parameters

2. Built-In Transaction Support

Easy transaction lifecycle management:

InitializeTransaction()

Commit()

Rollback()

Safe handling of shared connections.

3. Automatic SQL Parameter Discovery & Caching

SqlHelperParameterCache creates and caches stored procedure parameter sets.

Avoids repeated trips to SQL Server using DeriveParameters.

Provides deep clones to ensure thread-safety.

4. Object-to-SQL Parameter Mapping

SQLParamHelper allows:

Auto-generation of SqlParameter list from an object.

Support for numeric, string, GUID, datetime, boolean, and other primitives.

Attribute [IgnoreDbParameter] to omit properties from mapping.

5. DataSet & DataTable Conversion Utilities

Included in DataAccessConverter, offering:

Convert:

DataTable → List<T>

DataTable → IEnumerable<T>

DataSet → Dictionary<string, List<object>>

List<T> → DataTable

Multiple lists → DataSet

Advanced helpers:

Select distinct values

Shift column ordering

Move/rename table columns

6. Extension Methods for DataTable Manipulations

Included in DataTableExtensions:

Move one or more columns to specific indices.

Get column names by index.

Reorder columns without breaking row data.

7. Streamlined Data Access Layer

The DataAccessLayer class provides a clean API for:

Sync/async CRUD operations

Command preparation

Reader handling

Strong validation for:

Connection state

Null parameters

Argument correctness

🔧 Internal Enhancements

Safe cloning of SQL parameters before execution.

Consistent use of CommandTimeout for long-running procedures.

Support for both internal and external connection ownership modes.

Uses Microsoft.Data.SqlClient for modern SQL Server connectivity.

🐛 Known Limitations

Does not support Dapper-style automatic mapping (future enhancement possible).

SQL bulk copy not included in this version.

Parameter type inference follows simplified rules and may need extension for complex types.

📦 Target Frameworks

.NET 6, .NET 7, .NET 8, .NET 9, .NET 10

📘 Documentation

For full samples, including:

CRUD examples

Async patterns

Stored procedure patterns

Mapping examples