SQLHelper.DB 4.0.180

There is a newer version of this package available.
See the version list below for details.
dotnet add package SQLHelper.DB --version 4.0.180
                    
NuGet\Install-Package SQLHelper.DB -Version 4.0.180
                    
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="4.0.180" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SQLHelper.DB" Version="4.0.180" />
                    
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 4.0.180
                    
#r "nuget: SQLHelper.DB, 4.0.180"
                    
#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@4.0.180
                    
#: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=4.0.180
                    
Install as a Cake Addin
#tool nuget:?package=SQLHelper.DB&version=4.0.180
                    
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 net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.103 146 1/7/2026
5.0.102 395 12/24/2025
5.0.101 336 12/22/2025
5.0.100 597 12/11/2025
5.0.99 523 12/10/2025
5.0.98 440 12/10/2025
5.0.97 443 12/10/2025
5.0.96 702 12/1/2025
5.0.95 664 11/18/2025
5.0.94 400 11/18/2025
5.0.93 398 11/18/2025
5.0.92 416 11/14/2025
5.0.91 395 11/13/2025
5.0.90 294 11/13/2025
5.0.89 493 11/6/2025
5.0.88 346 10/31/2025
5.0.87 480 10/17/2025
5.0.86 193 10/17/2025
5.0.85 283 10/16/2025
5.0.84 294 10/15/2025
5.0.83 198 10/15/2025
5.0.82 190 10/15/2025
5.0.81 316 10/14/2025
5.0.80 191 10/14/2025
5.0.79 297 10/13/2025
5.0.78 194 10/12/2025
5.0.77 206 10/12/2025
5.0.76 542 9/30/2025
5.0.75 347 9/29/2025
5.0.74 328 9/25/2025
5.0.73 570 9/18/2025
5.0.72 431 9/17/2025
5.0.71 353 9/11/2025
5.0.70 250 9/10/2025
5.0.69 189 9/10/2025
5.0.68 192 9/10/2025
5.0.67 717 8/19/2025
5.0.66 198 8/19/2025
5.0.65 191 8/19/2025
5.0.64 193 8/19/2025
5.0.63 193 8/19/2025
5.0.62 348 8/18/2025
5.0.61 361 8/15/2025
5.0.60 457 8/6/2025
5.0.59 421 8/5/2025
5.0.58 290 8/5/2025
5.0.57 294 8/5/2025
5.0.56 272 8/5/2025
5.0.55 276 8/5/2025
5.0.54 416 8/4/2025
5.0.53 192 8/4/2025
5.0.52 495 7/28/2025
5.0.51 379 7/17/2025
5.0.50 468 7/14/2025
5.0.46 660 6/30/2025
5.0.45 216 6/30/2025
5.0.44 521 6/27/2025
5.0.43 312 6/27/2025
5.0.42 336 6/26/2025
5.0.41 326 6/18/2025
5.0.39 438 6/10/2025
5.0.38 321 5/30/2025
5.0.37 300 5/23/2025
5.0.36 392 5/14/2025
5.0.34 278 5/2/2025
5.0.33 320 4/28/2025
5.0.32 397 4/10/2025
5.0.30 346 3/15/2025
5.0.28 357 2/24/2025
5.0.27 718 2/12/2025
5.0.25 470 2/3/2025
5.0.24 368 1/30/2025
5.0.23 294 1/29/2025
5.0.22 356 1/24/2025
5.0.21 343 1/22/2025
5.0.20 332 1/16/2025
5.0.19 222 1/15/2025
5.0.15 297 1/13/2025
5.0.14 300 1/9/2025
5.0.13 519 12/17/2024
5.0.12 372 12/10/2024
5.0.11 203 12/10/2024
5.0.10 197 12/10/2024
5.0.9 275 12/9/2024
5.0.8 459 11/26/2024
5.0.7 189 11/26/2024
5.0.6 407 11/24/2024
5.0.5 200 11/24/2024
5.0.4 243 11/23/2024
4.0.218 322 11/20/2024
4.0.217 229 11/12/2024
4.0.216 408 11/11/2024
4.0.215 266 11/6/2024
4.0.214 342 11/5/2024
4.0.213 270 11/4/2024
4.0.212 300 11/1/2024
4.0.211 270 10/31/2024
4.0.210 272 10/30/2024
4.0.209 250 10/29/2024
4.0.208 346 10/25/2024
4.0.207 365 10/21/2024
4.0.206 327 10/16/2024
4.0.205 343 10/11/2024
4.0.204 272 10/10/2024
4.0.203 283 10/9/2024
4.0.202 375 10/2/2024
4.0.201 296 10/1/2024
4.0.200 320 9/30/2024
4.0.199 355 9/24/2024
4.0.198 318 9/23/2024
4.0.197 360 9/17/2024
4.0.196 367 9/10/2024
4.0.195 372 9/6/2024
4.0.194 391 9/3/2024
4.0.193 389 8/30/2024
4.0.192 290 8/29/2024
4.0.191 283 8/28/2024
4.0.190 294 8/27/2024
4.0.189 302 8/26/2024
4.0.188 312 8/23/2024
4.0.187 397 8/21/2024
4.0.186 554 8/16/2024
4.0.185 294 8/15/2024
4.0.184 323 8/14/2024
4.0.183 315 8/5/2024
4.0.182 293 8/2/2024
4.0.181 293 8/1/2024
4.0.180 389 7/26/2024
4.0.179 330 7/24/2024
4.0.178 365 7/11/2024
4.0.177 295 7/10/2024
4.0.176 201 7/10/2024
4.0.175 336 7/9/2024
4.0.174 458 7/5/2024
4.0.173 349 7/2/2024
4.0.172 416 6/27/2024
4.0.171 305 6/26/2024
4.0.170 390 6/24/2024
4.0.169 1,479 6/19/2024
4.0.168 301 6/18/2024
4.0.167 325 6/17/2024
4.0.166 335 6/14/2024
4.0.165 298 6/13/2024
4.0.164 437 6/3/2024
4.0.163 308 5/31/2024
4.0.162 304 5/30/2024
4.0.161 316 5/29/2024
4.0.160 526 5/27/2024
4.0.159 382 5/23/2024
4.0.158 385 5/21/2024
4.0.157 356 5/17/2024
4.0.156 284 5/16/2024
4.0.155 300 5/15/2024
4.0.154 343 5/8/2024
4.0.153 310 5/7/2024
4.0.152 309 5/6/2024
4.0.151 300 5/3/2024
4.0.150 1,023 5/2/2024
4.0.149 314 5/1/2024
4.0.148 317 4/30/2024
4.0.147 361 4/29/2024
4.0.146 335 4/25/2024
4.0.145 424 4/16/2024
4.0.144 339 4/12/2024
4.0.143 287 4/12/2024
4.0.142 304 4/11/2024
4.0.141 337 4/10/2024
4.0.140 297 4/9/2024
4.0.139 406 4/1/2024
4.0.138 348 3/29/2024
4.0.137 364 3/26/2024
4.0.136 332 3/22/2024
4.0.135 223 3/22/2024
4.0.134 394 3/18/2024
4.0.133 315 3/15/2024
4.0.132 299 3/14/2024
4.0.131 335 3/13/2024
4.0.130 332 3/11/2024
4.0.129 300 3/8/2024
4.0.128 267 3/7/2024
4.0.127 236 3/6/2024
4.0.126 238 3/5/2024
4.0.125 254 3/4/2024
4.0.124 1,764 3/1/2024
4.0.123 330 2/29/2024
4.0.122 210 2/28/2024
4.0.121 251 2/27/2024
4.0.120 466 2/26/2024
4.0.119 206 2/23/2024
4.0.118 235 2/22/2024
4.0.117 228 2/21/2024
4.0.116 241 2/20/2024
4.0.115 219 2/20/2024
4.0.114 1,078 2/19/2024
4.0.113 228 2/19/2024
4.0.112 351 2/16/2024
4.0.111 214 2/15/2024
4.0.110 256 2/14/2024
4.0.109 487 2/13/2024
4.0.108 314 2/12/2024
4.0.107 241 2/9/2024
4.0.106 374 2/8/2024
4.0.105 208 2/7/2024
4.0.104 204 2/7/2024
4.0.103 204 2/6/2024
4.0.102 1,036 2/2/2024
4.0.101 283 2/1/2024
4.0.100 216 2/1/2024
4.0.99 218 1/31/2024
4.0.98 213 1/30/2024
4.0.97 709 1/25/2024
4.0.96 287 1/24/2024
4.0.95 227 1/23/2024
4.0.94 1,740 1/16/2024
4.0.93 211 1/16/2024
4.0.92 322 1/15/2024
4.0.91 339 1/12/2024
4.0.90 210 1/11/2024
4.0.89 212 1/10/2024
4.0.88 720 1/8/2024
4.0.87 824 12/26/2023
4.0.86 209 12/26/2023
4.0.85 211 12/25/2023
4.0.84 560 12/22/2023
4.0.83 453 12/15/2023
4.0.82 224 12/14/2023
4.0.81 210 12/14/2023
4.0.80 239 12/13/2023
4.0.79 217 12/12/2023
4.0.78 1,195 12/11/2023
4.0.77 379 12/6/2023
4.0.76 377 12/5/2023
4.0.75 573 11/24/2023
4.0.74 415 11/21/2023
4.0.73 367 11/20/2023
4.0.72 265 11/20/2023
4.0.71 332 11/17/2023
4.0.70 790 11/16/2023
4.0.69 291 11/14/2023
4.0.68 417 11/9/2023
4.0.67 355 11/8/2023
4.0.66 296 11/7/2023
4.0.65 277 11/6/2023
4.0.64 316 11/3/2023
4.0.63 435 11/1/2023
4.0.62 196 11/1/2023
4.0.61 356 10/31/2023
4.0.60 337 10/30/2023
4.0.59 302 10/27/2023
4.0.58 311 10/26/2023
4.0.57 296 10/25/2023
4.0.56 301 10/17/2023
4.0.55 397 10/16/2023
4.0.54 422 10/12/2023
4.0.53 301 10/11/2023
4.0.52 348 10/5/2023
4.0.51 393 9/26/2023
4.0.50 423 9/22/2023
4.0.49 313 9/20/2023
4.0.48 293 9/19/2023
4.0.47 185 9/19/2023
4.0.46 371 9/18/2023
4.0.45 414 9/14/2023
4.0.44 323 9/13/2023
4.0.43 318 9/12/2023
4.0.42 350 9/11/2023
4.0.41 217 9/11/2023
4.0.40 302 9/11/2023
4.0.39 541 9/7/2023
4.0.38 327 9/6/2023
4.0.37 381 9/5/2023
4.0.36 229 9/5/2023
4.0.35 358 9/4/2023
4.0.34 412 9/1/2023
4.0.33 381 8/31/2023
4.0.32 360 8/30/2023
4.0.31 214 8/30/2023
4.0.30 380 8/29/2023
4.0.29 562 8/25/2023
4.0.28 488 8/23/2023
4.0.27 486 8/18/2023
4.0.26 342 8/17/2023
4.0.25 217 8/17/2023
4.0.24 222 8/17/2023
4.0.23 658 8/10/2023
4.0.22 362 8/9/2023
4.0.21 327 8/8/2023
4.0.20 247 8/8/2023
4.0.19 420 8/8/2023
4.0.18 510 8/7/2023
4.0.17 614 8/3/2023
4.0.16 537 7/26/2023
4.0.15 497 7/20/2023
4.0.14 518 7/18/2023
4.0.13 249 7/18/2023
4.0.12 248 7/18/2023
4.0.11 837 7/17/2023
4.0.10 261 7/14/2023
4.0.9 266 7/13/2023
4.0.8 244 7/13/2023
4.0.7 267 7/12/2023
4.0.6 266 7/12/2023
4.0.5 326 6/13/2023
4.0.4 1,731 1/30/2023
4.0.3 675 1/30/2023
4.0.2 681 1/27/2023
4.0.1 849 12/13/2022
4.0.0 656 12/12/2022
3.1.49 2,911 6/10/2022
3.1.47 1,991 4/20/2022
3.1.46 934 2/25/2022
3.1.45 2,202 1/11/2022
3.1.44 1,263 1/10/2022
3.1.43 1,279 10/12/2021
3.1.42 578 10/12/2021
3.1.41 1,912 6/17/2021
3.1.40 1,477 6/16/2021
3.1.39 1,334 6/16/2021
3.1.38 1,174 6/16/2021
3.1.37 883 6/15/2021
3.1.35 2,129 1/7/2021
3.1.34 1,582 12/16/2020
3.1.33 733 12/16/2020
3.1.32 1,396 12/14/2020
3.1.31 3,535 9/13/2020
3.1.30 1,919 6/19/2020
3.1.29 1,335 6/8/2020
3.1.28 2,704 5/12/2020
3.1.27 2,165 5/12/2020
3.1.26 1,686 4/28/2020
3.1.25 1,617 4/16/2020
3.1.23 1,539 4/16/2020
3.1.22 1,600 4/16/2020
3.1.21 1,315 4/15/2020
3.1.20 1,560 4/15/2020
3.1.19 1,623 4/14/2020
3.1.18 1,311 4/14/2020
3.1.17 786 4/14/2020
3.1.16 1,635 4/10/2020
3.1.15 1,643 4/10/2020
3.1.14 4,154 3/26/2020
3.1.13 1,669 3/26/2020
3.1.12 1,860 3/25/2020
3.1.11 1,329 3/25/2020
3.1.10 1,311 3/25/2020
3.1.9 1,797 3/25/2020
3.1.8 1,844 3/24/2020
3.1.7 2,519 3/21/2020
3.1.6 2,368 3/13/2020
3.1.5 1,352 3/13/2020
3.1.3 2,358 2/28/2020
3.1.1.2 778 2/28/2020
3.1.1 1,114 2/22/2020
3.1.0 1,372 2/21/2020
3.0.4 1,429 2/11/2020
3.0.3 1,097 2/11/2020
3.0.2 859 2/10/2020
3.0.1 1,836 1/9/2020
3.0.0 1,572 12/23/2019
2.0.18 2,884 6/19/2019
2.0.17 872 6/19/2019
2.0.16 2,383 4/17/2019
2.0.15 1,769 3/14/2019
2.0.14 937 2/22/2019
2.0.13 1,981 2/21/2019
2.0.12 915 2/21/2019
2.0.11 4,948 8/1/2018
2.0.10 2,014 8/1/2018
2.0.9 1,793 7/3/2018
2.0.8 2,328 6/26/2018
2.0.7 1,510 6/26/2018
2.0.6 2,110 6/14/2018
2.0.5 2,234 6/1/2018
2.0.4 2,528 5/22/2018
2.0.3 3,125 5/9/2018
2.0.2 2,759 2/15/2018
2.0.1 2,421 2/13/2018
2.0.0 3,210 1/2/2018
1.0.44 11,906 10/10/2017
1.0.42 1,290 10/10/2017
1.0.41 1,601 9/29/2017
1.0.40 4,717 9/19/2017
1.0.39 1,311 9/15/2017
1.0.36 1,292 9/15/2017
1.0.35 1,292 9/15/2017
1.0.34 3,707 7/3/2017
1.0.33 2,211 6/16/2017
1.0.32 2,205 6/16/2017
1.0.31 1,350 5/30/2017
1.0.28 2,084 5/30/2017
1.0.27 1,858 5/25/2017
1.0.26 2,119 5/24/2017
1.0.25 1,675 5/19/2017
1.0.24 1,363 5/19/2017
1.0.23 1,652 5/17/2017
1.0.20 1,461 5/8/2017
1.0.19 1,467 4/7/2017
1.0.18 2,096 3/22/2017
1.0.15 1,814 1/31/2017
1.0.14 1,464 1/24/2017
1.0.13 1,511 1/8/2017
1.0.12 1,476 1/6/2017
1.0.11 1,488 1/6/2017
1.0.10 1,448 1/3/2017
1.0.9 1,570 12/9/2016
1.0.8 1,402 12/1/2016
1.0.0 1,371 9/15/2017