SQLHelper.DB 5.0.101

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

SQLHelper

Build status

SQLHelper is a simple class to help with running queries against a database.

Basic Usage

In order to use the system, you do need register it with your ServiceCollection:

serviceCollection.AddCanisterModules();
				

This is required prior to using the SQLHelper class for the first time. Once Canister is set up, you can use the SQLHelper class:

var Configuration = new ConfigurationBuilder()
            .AddInMemoryCollection()
            .Build();
var Instance = new SQLHelper(Configuration, SqlClientFactory.Instance, "ConnectionString");

Or simply ask for an instance using dependency injection:

public MyClass(SQLHelper helper) { ... }

The SQLHelper class takes in a IConfiguration class, a DbProviderFactory class, and the connection string. The connection string can just be the name of a connection string in your configuration object. Once an instance is set up, you can create a batch, add queries, and then execute them.

var Results = Instance.CreateBatch()
            		   .AddQuery(CommandType.Text,"SELECT * FROM [TestDatabase].[dbo].[TestTable]")
            		   .AddQuery(CommandType.Text,"SELECT * FROM [TestDatabase].[dbo].[TestTable2]")
            		   .AddQuery(CommandType.Text,"SELECT * FROM [TestDatabase].[dbo].[TestTable3]")
            		   .Execute();
					   

The Results object then holds the results for all 3 queries and is returned as IList<IList<dynamic>>. So in order to get the results from the queries:

var FirstQueryResults = Results[0];
var SecondQueryResults = Results[1];
var ThirdQueryResults = Results[2];

It is also possible to convert the results from the dynamic type to a class type that you specify:

var TestTableClasses = FirstQueryResults.Select(x => (TestTableClass)x).ToList();

The type will be converted automatically for you with no special type conversion required. SQLHelper also has an ExecuteScalar function:

var Result = Instance.ExecuteScalar<int>();

This will either return the first value of the first set of results OR it will return the number of rows that were effected depending on whether or not the query was a select or not.

Installation

The library is available via Nuget with the package name "SQLHelper.DB". To install it run the following command in the Package Manager Console:

Install-Package SQLHelper.DB

Build Process

In order to build the library you will require the following as a minimum:

  1. Visual Studio 2022

Other than that, just clone the project and you should be able to load the solution and build without too much effort.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 (2)

Showing the top 2 NuGet packages that depend on SQLHelper.DB:

Package Downloads
Data.Modeler

Data.Modeler helps to model database schemas using C#.

Holmes

Holmes is a database analysis library designed to suggest improvements and optimizations. Supports .Net Core as well as full .Net.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.102 224 12/24/2025
5.0.101 308 12/22/2025
5.0.100 589 12/11/2025
5.0.99 515 12/10/2025
5.0.98 429 12/10/2025
5.0.97 433 12/10/2025
5.0.96 695 12/1/2025
5.0.95 652 11/18/2025
5.0.94 394 11/18/2025
5.0.93 391 11/18/2025
5.0.92 408 11/14/2025
5.0.91 391 11/13/2025
5.0.90 286 11/13/2025
5.0.89 486 11/6/2025
5.0.88 340 10/31/2025
5.0.87 476 10/17/2025
5.0.86 186 10/17/2025
5.0.85 276 10/16/2025
5.0.84 287 10/15/2025
5.0.83 192 10/15/2025
5.0.82 184 10/15/2025
5.0.81 310 10/14/2025
5.0.80 187 10/14/2025
5.0.79 291 10/13/2025
5.0.78 190 10/12/2025
5.0.77 200 10/12/2025
5.0.76 534 9/30/2025
5.0.75 342 9/29/2025
5.0.74 323 9/25/2025
5.0.73 567 9/18/2025
5.0.72 423 9/17/2025
5.0.71 351 9/11/2025
5.0.70 243 9/10/2025
5.0.69 184 9/10/2025
5.0.68 186 9/10/2025
5.0.67 712 8/19/2025
5.0.66 195 8/19/2025
5.0.65 186 8/19/2025
5.0.64 189 8/19/2025
5.0.63 185 8/19/2025
5.0.62 344 8/18/2025
5.0.61 354 8/15/2025
5.0.60 449 8/6/2025
5.0.59 414 8/5/2025
5.0.58 286 8/5/2025
5.0.57 288 8/5/2025
5.0.56 266 8/5/2025
5.0.55 271 8/5/2025
5.0.54 409 8/4/2025
5.0.53 186 8/4/2025
5.0.52 483 7/28/2025
5.0.51 372 7/17/2025
5.0.50 464 7/14/2025
5.0.46 651 6/30/2025
5.0.45 212 6/30/2025
5.0.44 517 6/27/2025
5.0.43 307 6/27/2025
5.0.42 330 6/26/2025
5.0.41 322 6/18/2025
5.0.39 433 6/10/2025
5.0.38 316 5/30/2025
5.0.37 296 5/23/2025
5.0.36 384 5/14/2025
5.0.34 272 5/2/2025
5.0.33 316 4/28/2025
5.0.32 393 4/10/2025
5.0.30 343 3/15/2025
5.0.28 351 2/24/2025
5.0.27 710 2/12/2025
5.0.25 464 2/3/2025
5.0.24 361 1/30/2025
5.0.23 287 1/29/2025
5.0.22 348 1/24/2025
5.0.21 336 1/22/2025
5.0.20 326 1/16/2025
5.0.19 217 1/15/2025
5.0.15 294 1/13/2025
5.0.14 296 1/9/2025
5.0.13 513 12/17/2024
5.0.12 368 12/10/2024
5.0.11 197 12/10/2024
5.0.10 190 12/10/2024
5.0.9 269 12/9/2024
5.0.8 455 11/26/2024
5.0.7 181 11/26/2024
5.0.6 400 11/24/2024
5.0.5 194 11/24/2024
5.0.4 236 11/23/2024
4.0.218 318 11/20/2024
4.0.217 223 11/12/2024
4.0.216 402 11/11/2024
4.0.215 261 11/6/2024
4.0.214 335 11/5/2024
4.0.213 266 11/4/2024
4.0.212 295 11/1/2024
4.0.211 265 10/31/2024
4.0.210 268 10/30/2024
4.0.209 245 10/29/2024
4.0.208 341 10/25/2024
4.0.207 359 10/21/2024
4.0.206 322 10/16/2024
4.0.205 338 10/11/2024
4.0.204 269 10/10/2024
4.0.203 276 10/9/2024
4.0.202 368 10/2/2024
4.0.201 292 10/1/2024
4.0.200 314 9/30/2024
4.0.199 350 9/24/2024
4.0.198 313 9/23/2024
4.0.197 355 9/17/2024
4.0.196 361 9/10/2024
4.0.195 367 9/6/2024
4.0.194 385 9/3/2024
4.0.193 385 8/30/2024
4.0.192 285 8/29/2024
4.0.191 278 8/28/2024
4.0.190 291 8/27/2024
4.0.189 296 8/26/2024
4.0.188 309 8/23/2024
4.0.187 390 8/21/2024
4.0.186 550 8/16/2024
4.0.185 290 8/15/2024
4.0.184 316 8/14/2024
4.0.183 309 8/5/2024
4.0.182 285 8/2/2024
4.0.181 288 8/1/2024
4.0.180 385 7/26/2024
4.0.179 327 7/24/2024
4.0.178 362 7/11/2024
4.0.177 289 7/10/2024
4.0.176 196 7/10/2024
4.0.175 330 7/9/2024
4.0.174 454 7/5/2024
4.0.173 345 7/2/2024
4.0.172 411 6/27/2024
4.0.171 299 6/26/2024
4.0.170 387 6/24/2024
4.0.169 1,476 6/19/2024
4.0.168 296 6/18/2024
4.0.167 321 6/17/2024
4.0.166 327 6/14/2024
4.0.165 291 6/13/2024
4.0.164 432 6/3/2024
4.0.163 303 5/31/2024
4.0.162 298 5/30/2024
4.0.161 305 5/29/2024
4.0.160 516 5/27/2024
4.0.159 376 5/23/2024
4.0.158 382 5/21/2024
4.0.157 349 5/17/2024
4.0.156 280 5/16/2024
4.0.155 296 5/15/2024
4.0.154 341 5/8/2024
4.0.153 303 5/7/2024
4.0.152 304 5/6/2024
4.0.151 296 5/3/2024
4.0.150 1,017 5/2/2024
4.0.149 309 5/1/2024
4.0.148 311 4/30/2024
4.0.147 356 4/29/2024
4.0.146 330 4/25/2024
4.0.145 416 4/16/2024
4.0.144 334 4/12/2024
4.0.143 281 4/12/2024
4.0.142 302 4/11/2024
4.0.141 329 4/10/2024
4.0.140 294 4/9/2024
4.0.139 403 4/1/2024
4.0.138 342 3/29/2024
4.0.137 359 3/26/2024
4.0.136 327 3/22/2024
4.0.135 219 3/22/2024
4.0.134 389 3/18/2024
4.0.133 311 3/15/2024
4.0.132 294 3/14/2024
4.0.131 328 3/13/2024
4.0.130 328 3/11/2024
4.0.129 296 3/8/2024
4.0.128 263 3/7/2024
4.0.127 232 3/6/2024
4.0.126 234 3/5/2024
4.0.125 249 3/4/2024
4.0.124 1,760 3/1/2024
4.0.123 324 2/29/2024
4.0.122 207 2/28/2024
4.0.121 248 2/27/2024
4.0.120 463 2/26/2024
4.0.119 201 2/23/2024
4.0.118 230 2/22/2024
4.0.117 224 2/21/2024
4.0.116 235 2/20/2024
4.0.115 215 2/20/2024
4.0.114 1,073 2/19/2024
4.0.113 223 2/19/2024
4.0.112 347 2/16/2024
4.0.111 209 2/15/2024
4.0.110 249 2/14/2024
4.0.109 482 2/13/2024
4.0.108 311 2/12/2024
4.0.107 235 2/9/2024
4.0.106 368 2/8/2024
4.0.105 202 2/7/2024
4.0.104 200 2/7/2024
4.0.103 198 2/6/2024
4.0.102 1,030 2/2/2024
4.0.101 275 2/1/2024
4.0.100 210 2/1/2024
4.0.99 213 1/31/2024
4.0.98 208 1/30/2024
4.0.97 703 1/25/2024
4.0.96 282 1/24/2024
4.0.95 221 1/23/2024
4.0.94 1,734 1/16/2024
4.0.93 207 1/16/2024
4.0.92 318 1/15/2024
4.0.91 334 1/12/2024
4.0.90 205 1/11/2024
4.0.89 206 1/10/2024
4.0.88 715 1/8/2024
4.0.87 817 12/26/2023
4.0.86 205 12/26/2023
4.0.85 206 12/25/2023
4.0.84 554 12/22/2023
4.0.83 447 12/15/2023
4.0.82 218 12/14/2023
4.0.81 204 12/14/2023
4.0.80 234 12/13/2023
4.0.79 210 12/12/2023
4.0.78 1,190 12/11/2023
4.0.77 377 12/6/2023
4.0.76 374 12/5/2023
4.0.75 569 11/24/2023
4.0.74 412 11/21/2023
4.0.73 361 11/20/2023
4.0.72 260 11/20/2023
4.0.71 329 11/17/2023
4.0.70 786 11/16/2023
4.0.69 287 11/14/2023
4.0.68 415 11/9/2023
4.0.67 353 11/8/2023
4.0.66 290 11/7/2023
4.0.65 275 11/6/2023
4.0.64 312 11/3/2023
4.0.63 431 11/1/2023
4.0.62 192 11/1/2023
4.0.61 354 10/31/2023
4.0.60 333 10/30/2023
4.0.59 300 10/27/2023
4.0.58 308 10/26/2023
4.0.57 291 10/25/2023
4.0.56 294 10/17/2023
4.0.55 393 10/16/2023
4.0.54 418 10/12/2023
4.0.53 299 10/11/2023
4.0.52 345 10/5/2023
4.0.51 388 9/26/2023
4.0.50 419 9/22/2023
4.0.49 311 9/20/2023
4.0.48 290 9/19/2023
4.0.47 181 9/19/2023
4.0.46 366 9/18/2023
4.0.45 411 9/14/2023
4.0.44 321 9/13/2023
4.0.43 313 9/12/2023
4.0.42 348 9/11/2023
4.0.41 216 9/11/2023
4.0.40 299 9/11/2023
4.0.39 537 9/7/2023
4.0.38 326 9/6/2023
4.0.37 378 9/5/2023
4.0.36 222 9/5/2023
4.0.35 354 9/4/2023
4.0.34 411 9/1/2023
4.0.33 377 8/31/2023
4.0.32 354 8/30/2023
4.0.31 210 8/30/2023
4.0.30 379 8/29/2023
4.0.29 560 8/25/2023
4.0.28 483 8/23/2023
4.0.27 482 8/18/2023
4.0.26 337 8/17/2023
4.0.25 213 8/17/2023
4.0.24 217 8/17/2023
4.0.23 654 8/10/2023
4.0.22 360 8/9/2023
4.0.21 324 8/8/2023
4.0.20 244 8/8/2023
4.0.19 417 8/8/2023
4.0.18 505 8/7/2023
4.0.17 610 8/3/2023
4.0.16 535 7/26/2023
4.0.15 493 7/20/2023
4.0.14 516 7/18/2023
4.0.13 249 7/18/2023
4.0.12 245 7/18/2023
4.0.11 835 7/17/2023
4.0.10 258 7/14/2023
4.0.9 261 7/13/2023
4.0.8 240 7/13/2023
4.0.7 264 7/12/2023
4.0.6 262 7/12/2023
4.0.5 323 6/13/2023
4.0.4 1,694 1/30/2023
4.0.3 670 1/30/2023
4.0.2 678 1/27/2023
4.0.1 846 12/13/2022
4.0.0 653 12/12/2022
3.1.49 2,908 6/10/2022
3.1.47 1,987 4/20/2022
3.1.46 929 2/25/2022
3.1.45 2,196 1/11/2022
3.1.44 1,259 1/10/2022
3.1.43 1,274 10/12/2021
3.1.42 573 10/12/2021
3.1.41 1,909 6/17/2021
3.1.40 1,476 6/16/2021
3.1.39 1,331 6/16/2021
3.1.38 1,170 6/16/2021
3.1.37 877 6/15/2021
3.1.35 2,126 1/7/2021
3.1.34 1,580 12/16/2020
3.1.33 729 12/16/2020
3.1.32 1,393 12/14/2020
3.1.31 3,532 9/13/2020
3.1.30 1,917 6/19/2020
3.1.29 1,330 6/8/2020
3.1.28 2,701 5/12/2020
3.1.27 2,163 5/12/2020
3.1.26 1,683 4/28/2020
3.1.25 1,614 4/16/2020
3.1.23 1,536 4/16/2020
3.1.22 1,596 4/16/2020
3.1.21 1,311 4/15/2020
3.1.20 1,557 4/15/2020
3.1.19 1,618 4/14/2020
3.1.18 1,307 4/14/2020
3.1.17 781 4/14/2020
3.1.16 1,633 4/10/2020
3.1.15 1,638 4/10/2020
3.1.14 4,150 3/26/2020
3.1.13 1,668 3/26/2020
3.1.12 1,854 3/25/2020
3.1.11 1,325 3/25/2020
3.1.10 1,307 3/25/2020
3.1.9 1,794 3/25/2020
3.1.8 1,842 3/24/2020
3.1.7 2,516 3/21/2020
3.1.6 2,364 3/13/2020
3.1.5 1,349 3/13/2020
3.1.3 2,353 2/28/2020
3.1.1.2 774 2/28/2020
3.1.1 1,107 2/22/2020
3.1.0 1,366 2/21/2020
3.0.4 1,426 2/11/2020
3.0.3 1,093 2/11/2020
3.0.2 856 2/10/2020
3.0.1 1,832 1/9/2020
3.0.0 1,569 12/23/2019
2.0.18 2,873 6/19/2019
2.0.17 870 6/19/2019
2.0.16 2,378 4/17/2019
2.0.15 1,763 3/14/2019
2.0.14 932 2/22/2019
2.0.13 1,975 2/21/2019
2.0.12 909 2/21/2019
2.0.11 4,945 8/1/2018
2.0.10 2,012 8/1/2018
2.0.9 1,787 7/3/2018
2.0.8 2,324 6/26/2018
2.0.7 1,506 6/26/2018
2.0.6 2,108 6/14/2018
2.0.5 2,230 6/1/2018
2.0.4 2,525 5/22/2018
2.0.3 3,124 5/9/2018
2.0.2 2,752 2/15/2018
2.0.1 2,415 2/13/2018
2.0.0 3,206 1/2/2018
1.0.44 11,902 10/10/2017
1.0.42 1,286 10/10/2017
1.0.41 1,596 9/29/2017
1.0.40 4,713 9/19/2017
1.0.39 1,305 9/15/2017
1.0.36 1,287 9/15/2017
1.0.35 1,284 9/15/2017
1.0.34 3,701 7/3/2017
1.0.33 2,208 6/16/2017
1.0.32 2,200 6/16/2017
1.0.31 1,344 5/30/2017
1.0.28 2,077 5/30/2017
1.0.27 1,853 5/25/2017
1.0.26 2,115 5/24/2017
1.0.25 1,672 5/19/2017
1.0.24 1,361 5/19/2017
1.0.23 1,647 5/17/2017
1.0.20 1,454 5/8/2017
1.0.19 1,464 4/7/2017
1.0.18 2,090 3/22/2017
1.0.15 1,808 1/31/2017
1.0.14 1,459 1/24/2017
1.0.13 1,504 1/8/2017
1.0.12 1,473 1/6/2017
1.0.11 1,483 1/6/2017
1.0.10 1,444 1/3/2017
1.0.9 1,564 12/9/2016
1.0.8 1,397 12/1/2016
1.0.0 1,367 9/15/2017