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.113 52 2/5/2026
5.0.112 49 2/5/2026
5.0.111 216 2/3/2026
5.0.110 65 2/3/2026
5.0.109 183 2/2/2026
5.0.108 339 1/21/2026
5.0.107 90 1/21/2026
5.0.106 302 1/19/2026
5.0.105 94 1/19/2026
5.0.104 99 1/17/2026
5.0.103 487 1/7/2026
5.0.102 404 12/24/2025
5.0.101 352 12/22/2025
5.0.100 608 12/11/2025
5.0.99 531 12/10/2025
5.0.98 453 12/10/2025
5.0.97 452 12/10/2025
5.0.96 711 12/1/2025
5.0.95 701 11/18/2025
5.0.94 413 11/18/2025
5.0.93 408 11/18/2025
5.0.92 425 11/14/2025
5.0.91 404 11/13/2025
5.0.90 304 11/13/2025
5.0.89 502 11/6/2025
5.0.88 354 10/31/2025
5.0.87 492 10/17/2025
5.0.86 205 10/17/2025
5.0.85 291 10/16/2025
5.0.84 302 10/15/2025
5.0.83 216 10/15/2025
5.0.82 199 10/15/2025
5.0.81 324 10/14/2025
5.0.80 204 10/14/2025
5.0.79 311 10/13/2025
5.0.78 201 10/12/2025
5.0.77 217 10/12/2025
5.0.76 551 9/30/2025
5.0.75 358 9/29/2025
5.0.74 340 9/25/2025
5.0.73 582 9/18/2025
5.0.72 439 9/17/2025
5.0.71 365 9/11/2025
5.0.70 261 9/10/2025
5.0.69 197 9/10/2025
5.0.68 202 9/10/2025
5.0.67 737 8/19/2025
5.0.66 208 8/19/2025
5.0.65 199 8/19/2025
5.0.64 202 8/19/2025
5.0.63 203 8/19/2025
5.0.62 363 8/18/2025
5.0.61 377 8/15/2025
5.0.60 470 8/6/2025
5.0.59 433 8/5/2025
5.0.58 300 8/5/2025
5.0.57 303 8/5/2025
5.0.56 285 8/5/2025
5.0.55 290 8/5/2025
5.0.54 423 8/4/2025
5.0.53 204 8/4/2025
5.0.52 521 7/28/2025
5.0.51 386 7/17/2025
5.0.50 475 7/14/2025
5.0.46 673 6/30/2025
5.0.45 229 6/30/2025
5.0.44 529 6/27/2025
5.0.43 324 6/27/2025
5.0.42 344 6/26/2025
5.0.41 337 6/18/2025
5.0.39 444 6/10/2025
5.0.38 330 5/30/2025
5.0.37 309 5/23/2025
5.0.36 403 5/14/2025
5.0.34 292 5/2/2025
5.0.33 331 4/28/2025
5.0.32 408 4/10/2025
5.0.30 356 3/15/2025
5.0.28 364 2/24/2025
5.0.27 729 2/12/2025
5.0.25 478 2/3/2025
5.0.24 381 1/30/2025
5.0.23 302 1/29/2025
5.0.22 367 1/24/2025
5.0.21 352 1/22/2025
5.0.20 341 1/16/2025
5.0.19 231 1/15/2025
5.0.15 303 1/13/2025
5.0.14 310 1/9/2025
5.0.13 531 12/17/2024
5.0.12 382 12/10/2024
5.0.11 214 12/10/2024
5.0.10 205 12/10/2024
5.0.9 286 12/9/2024
5.0.8 471 11/26/2024
5.0.7 201 11/26/2024
5.0.6 418 11/24/2024
5.0.5 210 11/24/2024
5.0.4 254 11/23/2024
4.0.218 333 11/20/2024
4.0.217 242 11/12/2024
4.0.216 420 11/11/2024
4.0.215 272 11/6/2024
4.0.214 356 11/5/2024
4.0.213 282 11/4/2024
4.0.212 312 11/1/2024
4.0.211 281 10/31/2024
4.0.210 280 10/30/2024
4.0.209 263 10/29/2024
4.0.208 355 10/25/2024
4.0.207 375 10/21/2024
4.0.206 334 10/16/2024
4.0.205 353 10/11/2024
4.0.204 283 10/10/2024
4.0.203 293 10/9/2024
4.0.202 388 10/2/2024
4.0.201 304 10/1/2024
4.0.200 334 9/30/2024
4.0.199 367 9/24/2024
4.0.198 327 9/23/2024
4.0.197 375 9/17/2024
4.0.196 376 9/10/2024
4.0.195 378 9/6/2024
4.0.194 404 9/3/2024
4.0.193 405 8/30/2024
4.0.192 302 8/29/2024
4.0.191 296 8/28/2024
4.0.190 305 8/27/2024
4.0.189 317 8/26/2024
4.0.188 321 8/23/2024
4.0.187 408 8/21/2024
4.0.186 564 8/16/2024
4.0.185 306 8/15/2024
4.0.184 337 8/14/2024
4.0.183 331 8/5/2024
4.0.182 303 8/2/2024
4.0.181 304 8/1/2024
4.0.180 399 7/26/2024
4.0.179 342 7/24/2024
4.0.178 379 7/11/2024
4.0.177 311 7/10/2024
4.0.176 219 7/10/2024
4.0.175 346 7/9/2024
4.0.174 474 7/5/2024
4.0.173 363 7/2/2024
4.0.172 426 6/27/2024
4.0.171 317 6/26/2024
4.0.170 405 6/24/2024
4.0.169 1,496 6/19/2024
4.0.168 317 6/18/2024
4.0.167 338 6/17/2024
4.0.166 346 6/14/2024
4.0.165 310 6/13/2024
4.0.164 448 6/3/2024
4.0.163 324 5/31/2024
4.0.162 319 5/30/2024
4.0.161 329 5/29/2024
4.0.160 549 5/27/2024
4.0.159 394 5/23/2024
4.0.158 399 5/21/2024
4.0.157 366 5/17/2024
4.0.156 293 5/16/2024
4.0.155 317 5/15/2024
4.0.154 353 5/8/2024
4.0.153 320 5/7/2024
4.0.152 322 5/6/2024
4.0.151 311 5/3/2024
4.0.150 1,033 5/2/2024
4.0.149 321 5/1/2024
4.0.148 327 4/30/2024
4.0.147 373 4/29/2024
4.0.146 345 4/25/2024
4.0.145 436 4/16/2024
4.0.144 353 4/12/2024
4.0.143 296 4/12/2024
4.0.142 319 4/11/2024
4.0.141 352 4/10/2024
4.0.140 313 4/9/2024
4.0.139 418 4/1/2024
4.0.138 357 3/29/2024
4.0.137 372 3/26/2024
4.0.136 342 3/22/2024
4.0.135 231 3/22/2024
4.0.134 405 3/18/2024
4.0.133 328 3/15/2024
4.0.132 310 3/14/2024
4.0.131 346 3/13/2024
4.0.130 341 3/11/2024
4.0.129 311 3/8/2024
4.0.128 278 3/7/2024
4.0.127 252 3/6/2024
4.0.126 250 3/5/2024
4.0.125 265 3/4/2024
4.0.124 1,781 3/1/2024
4.0.123 341 2/29/2024
4.0.122 223 2/28/2024
4.0.121 259 2/27/2024
4.0.120 479 2/26/2024
4.0.119 217 2/23/2024
4.0.118 245 2/22/2024
4.0.117 240 2/21/2024
4.0.116 251 2/20/2024
4.0.115 228 2/20/2024
4.0.114 1,088 2/19/2024
4.0.113 237 2/19/2024
4.0.112 359 2/16/2024
4.0.111 226 2/15/2024
4.0.110 268 2/14/2024
4.0.109 494 2/13/2024
4.0.108 323 2/12/2024
4.0.107 257 2/9/2024
4.0.106 383 2/8/2024
4.0.105 222 2/7/2024
4.0.104 213 2/7/2024
4.0.103 216 2/6/2024
4.0.102 1,051 2/2/2024
4.0.101 290 2/1/2024
4.0.100 224 2/1/2024
4.0.99 228 1/31/2024
4.0.98 225 1/30/2024
4.0.97 719 1/25/2024
4.0.96 296 1/24/2024
4.0.95 235 1/23/2024
4.0.94 1,750 1/16/2024
4.0.93 219 1/16/2024
4.0.92 330 1/15/2024
4.0.91 350 1/12/2024
4.0.90 219 1/11/2024
4.0.89 220 1/10/2024
4.0.88 730 1/8/2024
4.0.87 832 12/26/2023
4.0.86 216 12/26/2023
4.0.85 219 12/25/2023
4.0.84 567 12/22/2023
4.0.83 464 12/15/2023
4.0.82 238 12/14/2023
4.0.81 219 12/14/2023
4.0.80 248 12/13/2023
4.0.79 223 12/12/2023
4.0.78 1,205 12/11/2023
4.0.77 384 12/6/2023
4.0.76 387 12/5/2023
4.0.75 578 11/24/2023
4.0.74 423 11/21/2023
4.0.73 372 11/20/2023
4.0.72 268 11/20/2023
4.0.71 337 11/17/2023
4.0.70 794 11/16/2023
4.0.69 294 11/14/2023
4.0.68 424 11/9/2023
4.0.67 361 11/8/2023
4.0.66 300 11/7/2023
4.0.65 281 11/6/2023
4.0.64 318 11/3/2023
4.0.63 441 11/1/2023
4.0.62 201 11/1/2023
4.0.61 359 10/31/2023
4.0.60 347 10/30/2023
4.0.59 308 10/27/2023
4.0.58 317 10/26/2023
4.0.57 308 10/25/2023
4.0.56 310 10/17/2023
4.0.55 404 10/16/2023
4.0.54 426 10/12/2023
4.0.53 308 10/11/2023
4.0.52 357 10/5/2023
4.0.51 401 9/26/2023
4.0.50 431 9/22/2023
4.0.49 316 9/20/2023
4.0.48 299 9/19/2023
4.0.47 198 9/19/2023
4.0.46 378 9/18/2023
4.0.45 425 9/14/2023
4.0.44 330 9/13/2023
4.0.43 326 9/12/2023
4.0.42 353 9/11/2023
4.0.41 227 9/11/2023
4.0.40 305 9/11/2023
4.0.39 546 9/7/2023
4.0.38 333 9/6/2023
4.0.37 385 9/5/2023
4.0.36 237 9/5/2023
4.0.35 367 9/4/2023
4.0.34 415 9/1/2023
4.0.33 388 8/31/2023
4.0.32 370 8/30/2023
4.0.31 220 8/30/2023
4.0.30 389 8/29/2023
4.0.29 569 8/25/2023
4.0.28 491 8/23/2023
4.0.27 492 8/18/2023
4.0.26 349 8/17/2023
4.0.25 224 8/17/2023
4.0.24 232 8/17/2023
4.0.23 664 8/10/2023
4.0.22 368 8/9/2023
4.0.21 334 8/8/2023
4.0.20 256 8/8/2023
4.0.19 428 8/8/2023
4.0.18 516 8/7/2023
4.0.17 622 8/3/2023
4.0.16 543 7/26/2023
4.0.15 504 7/20/2023
4.0.14 526 7/18/2023
4.0.13 254 7/18/2023
4.0.12 252 7/18/2023
4.0.11 846 7/17/2023
4.0.10 264 7/14/2023
4.0.9 274 7/13/2023
4.0.8 252 7/13/2023
4.0.7 272 7/12/2023
4.0.6 274 7/12/2023
4.0.5 334 6/13/2023
4.0.4 1,812 1/30/2023
4.0.3 684 1/30/2023
4.0.2 688 1/27/2023
4.0.1 859 12/13/2022
4.0.0 662 12/12/2022
3.1.49 2,921 6/10/2022
3.1.47 2,001 4/20/2022
3.1.46 940 2/25/2022
3.1.45 2,206 1/11/2022
3.1.44 1,273 1/10/2022
3.1.43 1,283 10/12/2021
3.1.42 582 10/12/2021
3.1.41 1,916 6/17/2021
3.1.40 1,484 6/16/2021
3.1.39 1,340 6/16/2021
3.1.38 1,182 6/16/2021
3.1.37 888 6/15/2021
3.1.35 2,138 1/7/2021
3.1.34 1,586 12/16/2020
3.1.33 739 12/16/2020
3.1.32 1,403 12/14/2020
3.1.31 3,541 9/13/2020
3.1.30 1,924 6/19/2020
3.1.29 1,348 6/8/2020
3.1.28 2,710 5/12/2020
3.1.27 2,173 5/12/2020
3.1.26 1,693 4/28/2020
3.1.25 1,622 4/16/2020
3.1.23 1,546 4/16/2020
3.1.22 1,616 4/16/2020
3.1.21 1,323 4/15/2020
3.1.20 1,569 4/15/2020
3.1.19 1,628 4/14/2020
3.1.18 1,320 4/14/2020
3.1.17 789 4/14/2020
3.1.16 1,643 4/10/2020
3.1.15 1,647 4/10/2020
3.1.14 4,160 3/26/2020
3.1.13 1,676 3/26/2020
3.1.12 1,867 3/25/2020
3.1.11 1,337 3/25/2020
3.1.10 1,315 3/25/2020
3.1.9 1,803 3/25/2020
3.1.8 1,854 3/24/2020
3.1.7 2,528 3/21/2020
3.1.6 2,379 3/13/2020
3.1.5 1,358 3/13/2020
3.1.3 2,361 2/28/2020
3.1.1.2 785 2/28/2020
3.1.1 1,121 2/22/2020
3.1.0 1,382 2/21/2020
3.0.4 1,434 2/11/2020
3.0.3 1,105 2/11/2020
3.0.2 870 2/10/2020
3.0.1 1,840 1/9/2020
3.0.0 1,583 12/23/2019
2.0.18 2,900 6/19/2019
2.0.17 877 6/19/2019
2.0.16 2,393 4/17/2019
2.0.15 1,778 3/14/2019
2.0.14 947 2/22/2019
2.0.13 1,993 2/21/2019
2.0.12 924 2/21/2019
2.0.11 4,958 8/1/2018
2.0.10 2,023 8/1/2018
2.0.9 1,805 7/3/2018
2.0.8 2,340 6/26/2018
2.0.7 1,526 6/26/2018
2.0.6 2,126 6/14/2018
2.0.5 2,252 6/1/2018
2.0.4 2,542 5/22/2018
2.0.3 3,140 5/9/2018
2.0.2 2,776 2/15/2018
2.0.1 2,442 2/13/2018
2.0.0 3,226 1/2/2018
1.0.44 11,923 10/10/2017
1.0.42 1,304 10/10/2017
1.0.41 1,614 9/29/2017
1.0.40 4,731 9/19/2017
1.0.39 1,325 9/15/2017
1.0.36 1,303 9/15/2017
1.0.35 1,308 9/15/2017
1.0.34 3,718 7/3/2017
1.0.33 2,224 6/16/2017
1.0.32 2,215 6/16/2017
1.0.31 1,362 5/30/2017
1.0.28 2,098 5/30/2017
1.0.27 1,871 5/25/2017
1.0.26 2,131 5/24/2017
1.0.25 1,685 5/19/2017
1.0.24 1,375 5/19/2017
1.0.23 1,663 5/17/2017
1.0.20 1,475 5/8/2017
1.0.19 1,478 4/7/2017
1.0.18 2,105 3/22/2017
1.0.15 1,828 1/31/2017
1.0.14 1,479 1/24/2017
1.0.13 1,522 1/8/2017
1.0.12 1,487 1/6/2017
1.0.11 1,501 1/6/2017
1.0.10 1,461 1/3/2017
1.0.9 1,585 12/9/2016
1.0.8 1,414 12/1/2016
1.0.0 1,387 9/15/2017