SQLHelper.DB 5.0.104

There is a newer version of this package available.
See the version list below for details.
dotnet add package SQLHelper.DB --version 5.0.104
                    
NuGet\Install-Package SQLHelper.DB -Version 5.0.104
                    
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.104" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SQLHelper.DB" Version="5.0.104" />
                    
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.104
                    
#r "nuget: SQLHelper.DB, 5.0.104"
                    
#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.104
                    
#: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.104
                    
Install as a Cake Addin
#tool nuget:?package=SQLHelper.DB&version=5.0.104
                    
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.106 0 1/19/2026
5.0.105 0 1/19/2026
5.0.104 31 1/17/2026
5.0.103 371 1/7/2026
5.0.102 396 12/24/2025
5.0.101 340 12/22/2025
5.0.100 599 12/11/2025
5.0.99 525 12/10/2025
5.0.98 443 12/10/2025
5.0.97 446 12/10/2025
5.0.96 702 12/1/2025
5.0.95 676 11/18/2025
5.0.94 405 11/18/2025
5.0.93 400 11/18/2025
5.0.92 418 11/14/2025
5.0.91 397 11/13/2025
5.0.90 297 11/13/2025
5.0.89 495 11/6/2025
5.0.88 348 10/31/2025
5.0.87 484 10/17/2025
5.0.86 196 10/17/2025
5.0.85 284 10/16/2025
5.0.84 294 10/15/2025
5.0.83 204 10/15/2025
5.0.82 190 10/15/2025
5.0.81 317 10/14/2025
5.0.80 194 10/14/2025
5.0.79 302 10/13/2025
5.0.78 194 10/12/2025
5.0.77 209 10/12/2025
5.0.76 544 9/30/2025
5.0.75 350 9/29/2025
5.0.74 332 9/25/2025
5.0.73 575 9/18/2025
5.0.72 434 9/17/2025
5.0.71 359 9/11/2025
5.0.70 252 9/10/2025
5.0.69 190 9/10/2025
5.0.68 193 9/10/2025
5.0.67 724 8/19/2025
5.0.66 198 8/19/2025
5.0.65 192 8/19/2025
5.0.64 196 8/19/2025
5.0.63 194 8/19/2025
5.0.62 350 8/18/2025
5.0.61 368 8/15/2025
5.0.60 461 8/6/2025
5.0.59 423 8/5/2025
5.0.58 291 8/5/2025
5.0.57 296 8/5/2025
5.0.56 279 8/5/2025
5.0.55 281 8/5/2025
5.0.54 417 8/4/2025
5.0.53 193 8/4/2025
5.0.52 506 7/28/2025
5.0.51 379 7/17/2025
5.0.50 469 7/14/2025
5.0.46 664 6/30/2025
5.0.45 218 6/30/2025
5.0.44 523 6/27/2025
5.0.43 317 6/27/2025
5.0.42 337 6/26/2025
5.0.41 329 6/18/2025
5.0.39 438 6/10/2025
5.0.38 323 5/30/2025
5.0.37 302 5/23/2025
5.0.36 393 5/14/2025
5.0.34 283 5/2/2025
5.0.33 324 4/28/2025
5.0.32 401 4/10/2025
5.0.30 347 3/15/2025
5.0.28 358 2/24/2025
5.0.27 719 2/12/2025
5.0.25 471 2/3/2025
5.0.24 372 1/30/2025
5.0.23 296 1/29/2025
5.0.22 361 1/24/2025
5.0.21 343 1/22/2025
5.0.20 333 1/16/2025
5.0.19 225 1/15/2025
5.0.15 298 1/13/2025
5.0.14 304 1/9/2025
5.0.13 520 12/17/2024
5.0.12 373 12/10/2024
5.0.11 203 12/10/2024
5.0.10 198 12/10/2024
5.0.9 278 12/9/2024
5.0.8 460 11/26/2024
5.0.7 191 11/26/2024
5.0.6 409 11/24/2024
5.0.5 204 11/24/2024
5.0.4 243 11/23/2024
4.0.218 326 11/20/2024
4.0.217 234 11/12/2024
4.0.216 413 11/11/2024
4.0.215 266 11/6/2024
4.0.214 345 11/5/2024
4.0.213 272 11/4/2024
4.0.212 301 11/1/2024
4.0.211 273 10/31/2024
4.0.210 275 10/30/2024
4.0.209 254 10/29/2024
4.0.208 348 10/25/2024
4.0.207 366 10/21/2024
4.0.206 328 10/16/2024
4.0.205 345 10/11/2024
4.0.204 273 10/10/2024
4.0.203 287 10/9/2024
4.0.202 380 10/2/2024
4.0.201 299 10/1/2024
4.0.200 326 9/30/2024
4.0.199 356 9/24/2024
4.0.198 319 9/23/2024
4.0.197 363 9/17/2024
4.0.196 368 9/10/2024
4.0.195 372 9/6/2024
4.0.194 393 9/3/2024
4.0.193 393 8/30/2024
4.0.192 292 8/29/2024
4.0.191 287 8/28/2024
4.0.190 295 8/27/2024
4.0.189 304 8/26/2024
4.0.188 313 8/23/2024
4.0.187 401 8/21/2024
4.0.186 558 8/16/2024
4.0.185 296 8/15/2024
4.0.184 327 8/14/2024
4.0.183 316 8/5/2024
4.0.182 294 8/2/2024
4.0.181 296 8/1/2024
4.0.180 391 7/26/2024
4.0.179 332 7/24/2024
4.0.178 368 7/11/2024
4.0.177 299 7/10/2024
4.0.176 206 7/10/2024
4.0.175 338 7/9/2024
4.0.174 462 7/5/2024
4.0.173 351 7/2/2024
4.0.172 418 6/27/2024
4.0.171 309 6/26/2024
4.0.170 393 6/24/2024
4.0.169 1,484 6/19/2024
4.0.168 305 6/18/2024
4.0.167 327 6/17/2024
4.0.166 338 6/14/2024
4.0.165 303 6/13/2024
4.0.164 442 6/3/2024
4.0.163 311 5/31/2024
4.0.162 308 5/30/2024
4.0.161 323 5/29/2024
4.0.160 531 5/27/2024
4.0.159 387 5/23/2024
4.0.158 391 5/21/2024
4.0.157 357 5/17/2024
4.0.156 285 5/16/2024
4.0.155 306 5/15/2024
4.0.154 344 5/8/2024
4.0.153 315 5/7/2024
4.0.152 313 5/6/2024
4.0.151 303 5/3/2024
4.0.150 1,024 5/2/2024
4.0.149 316 5/1/2024
4.0.148 319 4/30/2024
4.0.147 363 4/29/2024
4.0.146 337 4/25/2024
4.0.145 429 4/16/2024
4.0.144 342 4/12/2024
4.0.143 287 4/12/2024
4.0.142 305 4/11/2024
4.0.141 342 4/10/2024
4.0.140 304 4/9/2024
4.0.139 410 4/1/2024
4.0.138 350 3/29/2024
4.0.137 366 3/26/2024
4.0.136 335 3/22/2024
4.0.135 223 3/22/2024
4.0.134 397 3/18/2024
4.0.133 317 3/15/2024
4.0.132 300 3/14/2024
4.0.131 339 3/13/2024
4.0.130 334 3/11/2024
4.0.129 303 3/8/2024
4.0.128 270 3/7/2024
4.0.127 240 3/6/2024
4.0.126 239 3/5/2024
4.0.125 258 3/4/2024
4.0.124 1,771 3/1/2024
4.0.123 332 2/29/2024
4.0.122 212 2/28/2024
4.0.121 252 2/27/2024
4.0.120 472 2/26/2024
4.0.119 207 2/23/2024
4.0.118 237 2/22/2024
4.0.117 230 2/21/2024
4.0.116 244 2/20/2024
4.0.115 221 2/20/2024
4.0.114 1,081 2/19/2024
4.0.113 231 2/19/2024
4.0.112 352 2/16/2024
4.0.111 219 2/15/2024
4.0.110 258 2/14/2024
4.0.109 488 2/13/2024
4.0.108 316 2/12/2024
4.0.107 246 2/9/2024
4.0.106 376 2/8/2024
4.0.105 211 2/7/2024
4.0.104 204 2/7/2024
4.0.103 207 2/6/2024
4.0.102 1,039 2/2/2024
4.0.101 285 2/1/2024
4.0.100 218 2/1/2024
4.0.99 220 1/31/2024
4.0.98 215 1/30/2024
4.0.97 713 1/25/2024
4.0.96 287 1/24/2024
4.0.95 230 1/23/2024
4.0.94 1,744 1/16/2024
4.0.93 213 1/16/2024
4.0.92 323 1/15/2024
4.0.91 341 1/12/2024
4.0.90 212 1/11/2024
4.0.89 214 1/10/2024
4.0.88 724 1/8/2024
4.0.87 825 12/26/2023
4.0.86 210 12/26/2023
4.0.85 212 12/25/2023
4.0.84 561 12/22/2023
4.0.83 455 12/15/2023
4.0.82 230 12/14/2023
4.0.81 212 12/14/2023
4.0.80 241 12/13/2023
4.0.79 217 12/12/2023
4.0.78 1,198 12/11/2023
4.0.77 381 12/6/2023
4.0.76 381 12/5/2023
4.0.75 574 11/24/2023
4.0.74 419 11/21/2023
4.0.73 369 11/20/2023
4.0.72 267 11/20/2023
4.0.71 335 11/17/2023
4.0.70 792 11/16/2023
4.0.69 293 11/14/2023
4.0.68 420 11/9/2023
4.0.67 357 11/8/2023
4.0.66 297 11/7/2023
4.0.65 277 11/6/2023
4.0.64 317 11/3/2023
4.0.63 436 11/1/2023
4.0.62 197 11/1/2023
4.0.61 357 10/31/2023
4.0.60 340 10/30/2023
4.0.59 305 10/27/2023
4.0.58 316 10/26/2023
4.0.57 301 10/25/2023
4.0.56 303 10/17/2023
4.0.55 399 10/16/2023
4.0.54 423 10/12/2023
4.0.53 306 10/11/2023
4.0.52 350 10/5/2023
4.0.51 398 9/26/2023
4.0.50 425 9/22/2023
4.0.49 314 9/20/2023
4.0.48 296 9/19/2023
4.0.47 186 9/19/2023
4.0.46 375 9/18/2023
4.0.45 422 9/14/2023
4.0.44 327 9/13/2023
4.0.43 323 9/12/2023
4.0.42 351 9/11/2023
4.0.41 219 9/11/2023
4.0.40 303 9/11/2023
4.0.39 542 9/7/2023
4.0.38 329 9/6/2023
4.0.37 382 9/5/2023
4.0.36 232 9/5/2023
4.0.35 360 9/4/2023
4.0.34 413 9/1/2023
4.0.33 383 8/31/2023
4.0.32 365 8/30/2023
4.0.31 215 8/30/2023
4.0.30 382 8/29/2023
4.0.29 565 8/25/2023
4.0.28 490 8/23/2023
4.0.27 488 8/18/2023
4.0.26 346 8/17/2023
4.0.25 221 8/17/2023
4.0.24 227 8/17/2023
4.0.23 660 8/10/2023
4.0.22 363 8/9/2023
4.0.21 330 8/8/2023
4.0.20 251 8/8/2023
4.0.19 421 8/8/2023
4.0.18 512 8/7/2023
4.0.17 619 8/3/2023
4.0.16 538 7/26/2023
4.0.15 498 7/20/2023
4.0.14 521 7/18/2023
4.0.13 250 7/18/2023
4.0.12 250 7/18/2023
4.0.11 840 7/17/2023
4.0.10 262 7/14/2023
4.0.9 271 7/13/2023
4.0.8 246 7/13/2023
4.0.7 268 7/12/2023
4.0.6 270 7/12/2023
4.0.5 331 6/13/2023
4.0.4 1,741 1/30/2023
4.0.3 678 1/30/2023
4.0.2 683 1/27/2023
4.0.1 853 12/13/2022
4.0.0 658 12/12/2022
3.1.49 2,915 6/10/2022
3.1.47 1,995 4/20/2022
3.1.46 935 2/25/2022
3.1.45 2,204 1/11/2022
3.1.44 1,266 1/10/2022
3.1.43 1,282 10/12/2021
3.1.42 581 10/12/2021
3.1.41 1,914 6/17/2021
3.1.40 1,478 6/16/2021
3.1.39 1,335 6/16/2021
3.1.38 1,174 6/16/2021
3.1.37 886 6/15/2021
3.1.35 2,131 1/7/2021
3.1.34 1,584 12/16/2020
3.1.33 738 12/16/2020
3.1.32 1,399 12/14/2020
3.1.31 3,537 9/13/2020
3.1.30 1,922 6/19/2020
3.1.29 1,343 6/8/2020
3.1.28 2,708 5/12/2020
3.1.27 2,171 5/12/2020
3.1.26 1,690 4/28/2020
3.1.25 1,620 4/16/2020
3.1.23 1,543 4/16/2020
3.1.22 1,604 4/16/2020
3.1.21 1,319 4/15/2020
3.1.20 1,565 4/15/2020
3.1.19 1,626 4/14/2020
3.1.18 1,314 4/14/2020
3.1.17 788 4/14/2020
3.1.16 1,638 4/10/2020
3.1.15 1,645 4/10/2020
3.1.14 4,158 3/26/2020
3.1.13 1,671 3/26/2020
3.1.12 1,864 3/25/2020
3.1.11 1,333 3/25/2020
3.1.10 1,313 3/25/2020
3.1.9 1,799 3/25/2020
3.1.8 1,851 3/24/2020
3.1.7 2,523 3/21/2020
3.1.6 2,372 3/13/2020
3.1.5 1,354 3/13/2020
3.1.3 2,359 2/28/2020
3.1.1.2 780 2/28/2020
3.1.1 1,116 2/22/2020
3.1.0 1,375 2/21/2020
3.0.4 1,432 2/11/2020
3.0.3 1,099 2/11/2020
3.0.2 862 2/10/2020
3.0.1 1,838 1/9/2020
3.0.0 1,574 12/23/2019
2.0.18 2,889 6/19/2019
2.0.17 875 6/19/2019
2.0.16 2,389 4/17/2019
2.0.15 1,774 3/14/2019
2.0.14 943 2/22/2019
2.0.13 1,987 2/21/2019
2.0.12 917 2/21/2019
2.0.11 4,949 8/1/2018
2.0.10 2,015 8/1/2018
2.0.9 1,793 7/3/2018
2.0.8 2,329 6/26/2018
2.0.7 1,513 6/26/2018
2.0.6 2,113 6/14/2018
2.0.5 2,237 6/1/2018
2.0.4 2,529 5/22/2018
2.0.3 3,128 5/9/2018
2.0.2 2,762 2/15/2018
2.0.1 2,424 2/13/2018
2.0.0 3,214 1/2/2018
1.0.44 11,911 10/10/2017
1.0.42 1,293 10/10/2017
1.0.41 1,603 9/29/2017
1.0.40 4,719 9/19/2017
1.0.39 1,315 9/15/2017
1.0.36 1,293 9/15/2017
1.0.35 1,297 9/15/2017
1.0.34 3,709 7/3/2017
1.0.33 2,211 6/16/2017
1.0.32 2,207 6/16/2017
1.0.31 1,353 5/30/2017
1.0.28 2,088 5/30/2017
1.0.27 1,861 5/25/2017
1.0.26 2,119 5/24/2017
1.0.25 1,675 5/19/2017
1.0.24 1,365 5/19/2017
1.0.23 1,654 5/17/2017
1.0.20 1,463 5/8/2017
1.0.19 1,468 4/7/2017
1.0.18 2,096 3/22/2017
1.0.15 1,816 1/31/2017
1.0.14 1,466 1/24/2017
1.0.13 1,512 1/8/2017
1.0.12 1,478 1/6/2017
1.0.11 1,491 1/6/2017
1.0.10 1,450 1/3/2017
1.0.9 1,573 12/9/2016
1.0.8 1,406 12/1/2016
1.0.0 1,375 9/15/2017