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.89 217 11/6/2025
5.0.88 295 10/31/2025
5.0.87 456 10/17/2025
5.0.86 160 10/17/2025
5.0.85 252 10/16/2025
5.0.84 262 10/15/2025
5.0.83 170 10/15/2025
5.0.82 165 10/15/2025
5.0.81 290 10/14/2025
5.0.80 164 10/14/2025
5.0.79 270 10/13/2025
5.0.78 171 10/12/2025
5.0.77 173 10/12/2025
5.0.76 517 9/30/2025
5.0.75 322 9/29/2025
5.0.74 297 9/25/2025
5.0.73 544 9/18/2025
5.0.72 406 9/17/2025
5.0.71 326 9/11/2025
5.0.70 222 9/10/2025
5.0.69 164 9/10/2025
5.0.68 164 9/10/2025
5.0.67 690 8/19/2025
5.0.66 175 8/19/2025
5.0.65 168 8/19/2025
5.0.64 170 8/19/2025
5.0.63 164 8/19/2025
5.0.62 320 8/18/2025
5.0.61 328 8/15/2025
5.0.60 428 8/6/2025
5.0.59 397 8/5/2025
5.0.58 265 8/5/2025
5.0.57 266 8/5/2025
5.0.56 239 8/5/2025
5.0.55 250 8/5/2025
5.0.54 389 8/4/2025
5.0.53 168 8/4/2025
5.0.52 437 7/28/2025
5.0.51 350 7/17/2025
5.0.50 441 7/14/2025
5.0.46 625 6/30/2025
5.0.45 192 6/30/2025
5.0.44 496 6/27/2025
5.0.43 284 6/27/2025
5.0.42 309 6/26/2025
5.0.41 299 6/18/2025
5.0.39 411 6/10/2025
5.0.38 299 5/30/2025
5.0.37 274 5/23/2025
5.0.36 367 5/14/2025
5.0.34 254 5/2/2025
5.0.33 293 4/28/2025
5.0.32 371 4/10/2025
5.0.30 322 3/15/2025
5.0.28 335 2/24/2025
5.0.27 689 2/12/2025
5.0.25 446 2/3/2025
5.0.24 343 1/30/2025
5.0.23 272 1/29/2025
5.0.22 326 1/24/2025
5.0.21 317 1/22/2025
5.0.20 307 1/16/2025
5.0.19 202 1/15/2025
5.0.15 270 1/13/2025
5.0.14 279 1/9/2025
5.0.13 492 12/17/2024
5.0.12 351 12/10/2024
5.0.11 177 12/10/2024
5.0.10 173 12/10/2024
5.0.9 250 12/9/2024
5.0.8 437 11/26/2024
5.0.7 166 11/26/2024
5.0.6 379 11/24/2024
5.0.5 175 11/24/2024
5.0.4 218 11/23/2024
4.0.218 300 11/20/2024
4.0.217 205 11/12/2024
4.0.216 383 11/11/2024
4.0.215 243 11/6/2024
4.0.214 320 11/5/2024
4.0.213 249 11/4/2024
4.0.212 274 11/1/2024
4.0.211 244 10/31/2024
4.0.210 249 10/30/2024
4.0.209 227 10/29/2024
4.0.208 322 10/25/2024
4.0.207 341 10/21/2024
4.0.206 300 10/16/2024
4.0.205 322 10/11/2024
4.0.204 253 10/10/2024
4.0.203 257 10/9/2024
4.0.202 353 10/2/2024
4.0.201 273 10/1/2024
4.0.200 290 9/30/2024
4.0.199 332 9/24/2024
4.0.198 292 9/23/2024
4.0.197 334 9/17/2024
4.0.196 347 9/10/2024
4.0.195 352 9/6/2024
4.0.194 365 9/3/2024
4.0.193 366 8/30/2024
4.0.192 269 8/29/2024
4.0.191 258 8/28/2024
4.0.190 274 8/27/2024
4.0.189 285 8/26/2024
4.0.188 293 8/23/2024
4.0.187 373 8/21/2024
4.0.186 533 8/16/2024
4.0.185 277 8/15/2024
4.0.184 297 8/14/2024
4.0.183 291 8/5/2024
4.0.182 269 8/2/2024
4.0.181 270 8/1/2024
4.0.180 364 7/26/2024
4.0.179 308 7/24/2024
4.0.178 340 7/11/2024
4.0.177 267 7/10/2024
4.0.176 182 7/10/2024
4.0.175 309 7/9/2024
4.0.174 439 7/5/2024
4.0.173 328 7/2/2024
4.0.172 395 6/27/2024
4.0.171 282 6/26/2024
4.0.170 369 6/24/2024
4.0.169 1,461 6/19/2024
4.0.168 277 6/18/2024
4.0.167 303 6/17/2024
4.0.166 307 6/14/2024
4.0.165 275 6/13/2024
4.0.164 417 6/3/2024
4.0.163 283 5/31/2024
4.0.162 284 5/30/2024
4.0.161 285 5/29/2024
4.0.160 497 5/27/2024
4.0.159 358 5/23/2024
4.0.158 366 5/21/2024
4.0.157 337 5/17/2024
4.0.156 262 5/16/2024
4.0.155 280 5/15/2024
4.0.154 322 5/8/2024
4.0.153 286 5/7/2024
4.0.152 287 5/6/2024
4.0.151 278 5/3/2024
4.0.150 1,003 5/2/2024
4.0.149 295 5/1/2024
4.0.148 293 4/30/2024
4.0.147 341 4/29/2024
4.0.146 314 4/25/2024
4.0.145 398 4/16/2024
4.0.144 314 4/12/2024
4.0.143 266 4/12/2024
4.0.142 282 4/11/2024
4.0.141 313 4/10/2024
4.0.140 279 4/9/2024
4.0.139 386 4/1/2024
4.0.138 325 3/29/2024
4.0.137 339 3/26/2024
4.0.136 309 3/22/2024
4.0.135 201 3/22/2024
4.0.134 375 3/18/2024
4.0.133 290 3/15/2024
4.0.132 277 3/14/2024
4.0.131 310 3/13/2024
4.0.130 307 3/11/2024
4.0.129 279 3/8/2024
4.0.128 245 3/7/2024
4.0.127 217 3/6/2024
4.0.126 218 3/5/2024
4.0.125 230 3/4/2024
4.0.124 1,742 3/1/2024
4.0.123 305 2/29/2024
4.0.122 190 2/28/2024
4.0.121 230 2/27/2024
4.0.120 444 2/26/2024
4.0.119 184 2/23/2024
4.0.118 210 2/22/2024
4.0.117 211 2/21/2024
4.0.116 215 2/20/2024
4.0.115 194 2/20/2024
4.0.114 1,058 2/19/2024
4.0.113 208 2/19/2024
4.0.112 330 2/16/2024
4.0.111 194 2/15/2024
4.0.110 231 2/14/2024
4.0.109 465 2/13/2024
4.0.108 294 2/12/2024
4.0.107 220 2/9/2024
4.0.106 349 2/8/2024
4.0.105 188 2/7/2024
4.0.104 186 2/7/2024
4.0.103 185 2/6/2024
4.0.102 1,015 2/2/2024
4.0.101 254 2/1/2024
4.0.100 190 2/1/2024
4.0.99 195 1/31/2024
4.0.98 189 1/30/2024
4.0.97 688 1/25/2024
4.0.96 268 1/24/2024
4.0.95 203 1/23/2024
4.0.94 1,722 1/16/2024
4.0.93 191 1/16/2024
4.0.92 303 1/15/2024
4.0.91 317 1/12/2024
4.0.90 187 1/11/2024
4.0.89 188 1/10/2024
4.0.88 699 1/8/2024
4.0.87 797 12/26/2023
4.0.86 188 12/26/2023
4.0.85 193 12/25/2023
4.0.84 534 12/22/2023
4.0.83 429 12/15/2023
4.0.82 200 12/14/2023
4.0.81 189 12/14/2023
4.0.80 216 12/13/2023
4.0.79 191 12/12/2023
4.0.78 1,175 12/11/2023
4.0.77 365 12/6/2023
4.0.76 361 12/5/2023
4.0.75 556 11/24/2023
4.0.74 400 11/21/2023
4.0.73 353 11/20/2023
4.0.72 246 11/20/2023
4.0.71 316 11/17/2023
4.0.70 780 11/16/2023
4.0.69 270 11/14/2023
4.0.68 407 11/9/2023
4.0.67 344 11/8/2023
4.0.66 283 11/7/2023
4.0.65 269 11/6/2023
4.0.64 302 11/3/2023
4.0.63 419 11/1/2023
4.0.62 182 11/1/2023
4.0.61 347 10/31/2023
4.0.60 323 10/30/2023
4.0.59 291 10/27/2023
4.0.58 300 10/26/2023
4.0.57 281 10/25/2023
4.0.56 286 10/17/2023
4.0.55 384 10/16/2023
4.0.54 406 10/12/2023
4.0.53 290 10/11/2023
4.0.52 337 10/5/2023
4.0.51 379 9/26/2023
4.0.50 405 9/22/2023
4.0.49 298 9/20/2023
4.0.48 275 9/19/2023
4.0.47 171 9/19/2023
4.0.46 351 9/18/2023
4.0.45 399 9/14/2023
4.0.44 301 9/13/2023
4.0.43 300 9/12/2023
4.0.42 338 9/11/2023
4.0.41 207 9/11/2023
4.0.40 285 9/11/2023
4.0.39 532 9/7/2023
4.0.38 316 9/6/2023
4.0.37 373 9/5/2023
4.0.36 213 9/5/2023
4.0.35 348 9/4/2023
4.0.34 400 9/1/2023
4.0.33 368 8/31/2023
4.0.32 344 8/30/2023
4.0.31 202 8/30/2023
4.0.30 370 8/29/2023
4.0.29 545 8/25/2023
4.0.28 473 8/23/2023
4.0.27 471 8/18/2023
4.0.26 322 8/17/2023
4.0.25 205 8/17/2023
4.0.24 207 8/17/2023
4.0.23 643 8/10/2023
4.0.22 346 8/9/2023
4.0.21 314 8/8/2023
4.0.20 233 8/8/2023
4.0.19 407 8/8/2023
4.0.18 493 8/7/2023
4.0.17 597 8/3/2023
4.0.16 528 7/26/2023
4.0.15 479 7/20/2023
4.0.14 507 7/18/2023
4.0.13 238 7/18/2023
4.0.12 232 7/18/2023
4.0.11 821 7/17/2023
4.0.10 245 7/14/2023
4.0.9 243 7/13/2023
4.0.8 228 7/13/2023
4.0.7 253 7/12/2023
4.0.6 248 7/12/2023
4.0.5 309 6/13/2023
4.0.4 1,526 1/30/2023
4.0.3 653 1/30/2023
4.0.2 657 1/27/2023
4.0.1 830 12/13/2022
4.0.0 638 12/12/2022
3.1.49 2,886 6/10/2022
3.1.47 1,970 4/20/2022
3.1.46 907 2/25/2022
3.1.45 2,175 1/11/2022
3.1.44 1,240 1/10/2022
3.1.43 1,255 10/12/2021
3.1.42 550 10/12/2021
3.1.41 1,880 6/17/2021
3.1.40 1,451 6/16/2021
3.1.39 1,308 6/16/2021
3.1.38 1,140 6/16/2021
3.1.37 856 6/15/2021
3.1.35 2,097 1/7/2021
3.1.34 1,552 12/16/2020
3.1.33 700 12/16/2020
3.1.32 1,363 12/14/2020
3.1.31 3,487 9/13/2020
3.1.30 1,887 6/19/2020
3.1.29 1,304 6/8/2020
3.1.28 2,670 5/12/2020
3.1.27 2,136 5/12/2020
3.1.26 1,652 4/28/2020
3.1.25 1,583 4/16/2020
3.1.23 1,506 4/16/2020
3.1.22 1,565 4/16/2020
3.1.21 1,284 4/15/2020
3.1.20 1,524 4/15/2020
3.1.19 1,590 4/14/2020
3.1.18 1,280 4/14/2020
3.1.17 751 4/14/2020
3.1.16 1,605 4/10/2020
3.1.15 1,610 4/10/2020
3.1.14 4,120 3/26/2020
3.1.13 1,636 3/26/2020
3.1.12 1,828 3/25/2020
3.1.11 1,292 3/25/2020
3.1.10 1,280 3/25/2020
3.1.9 1,763 3/25/2020
3.1.8 1,817 3/24/2020
3.1.7 2,487 3/21/2020
3.1.6 2,337 3/13/2020
3.1.5 1,320 3/13/2020
3.1.3 2,319 2/28/2020
3.1.1.2 746 2/28/2020
3.1.1 1,076 2/22/2020
3.1.0 1,340 2/21/2020
3.0.4 1,399 2/11/2020
3.0.3 1,062 2/11/2020
3.0.2 826 2/10/2020
3.0.1 1,804 1/9/2020
3.0.0 1,537 12/23/2019
2.0.18 2,814 6/19/2019
2.0.17 842 6/19/2019
2.0.16 2,348 4/17/2019
2.0.15 1,730 3/14/2019
2.0.14 905 2/22/2019
2.0.13 1,942 2/21/2019
2.0.12 880 2/21/2019
2.0.11 4,894 8/1/2018
2.0.10 1,963 8/1/2018
2.0.9 1,711 7/3/2018
2.0.8 2,250 6/26/2018
2.0.7 1,438 6/26/2018
2.0.6 2,033 6/14/2018
2.0.5 2,161 6/1/2018
2.0.4 2,457 5/22/2018
2.0.3 3,053 5/9/2018
2.0.2 2,680 2/15/2018
2.0.1 2,338 2/13/2018
2.0.0 3,134 1/2/2018
1.0.44 11,848 10/10/2017
1.0.42 1,233 10/10/2017
1.0.41 1,542 9/29/2017
1.0.40 4,664 9/19/2017
1.0.39 1,255 9/15/2017
1.0.36 1,235 9/15/2017
1.0.35 1,231 9/15/2017
1.0.34 3,647 7/3/2017
1.0.33 2,156 6/16/2017
1.0.32 2,151 6/16/2017
1.0.31 1,290 5/30/2017
1.0.28 2,021 5/30/2017
1.0.27 1,796 5/25/2017
1.0.26 2,061 5/24/2017
1.0.25 1,621 5/19/2017
1.0.24 1,304 5/19/2017
1.0.23 1,593 5/17/2017
1.0.20 1,401 5/8/2017
1.0.19 1,414 4/7/2017
1.0.18 2,038 3/22/2017
1.0.15 1,758 1/31/2017
1.0.14 1,415 1/24/2017
1.0.13 1,451 1/8/2017
1.0.12 1,419 1/6/2017
1.0.11 1,430 1/6/2017
1.0.10 1,389 1/3/2017
1.0.9 1,516 12/9/2016
1.0.8 1,346 12/1/2016
1.0.0 1,317 9/15/2017