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 30 12/24/2025
5.0.101 132 12/22/2025
5.0.100 583 12/11/2025
5.0.99 509 12/10/2025
5.0.98 425 12/10/2025
5.0.97 430 12/10/2025
5.0.96 691 12/1/2025
5.0.95 650 11/18/2025
5.0.94 393 11/18/2025
5.0.93 389 11/18/2025
5.0.92 407 11/14/2025
5.0.91 388 11/13/2025
5.0.90 286 11/13/2025
5.0.89 485 11/6/2025
5.0.88 338 10/31/2025
5.0.87 474 10/17/2025
5.0.86 183 10/17/2025
5.0.85 275 10/16/2025
5.0.84 284 10/15/2025
5.0.83 191 10/15/2025
5.0.82 183 10/15/2025
5.0.81 310 10/14/2025
5.0.80 185 10/14/2025
5.0.79 288 10/13/2025
5.0.78 188 10/12/2025
5.0.77 198 10/12/2025
5.0.76 531 9/30/2025
5.0.75 339 9/29/2025
5.0.74 319 9/25/2025
5.0.73 565 9/18/2025
5.0.72 422 9/17/2025
5.0.71 348 9/11/2025
5.0.70 243 9/10/2025
5.0.69 183 9/10/2025
5.0.68 184 9/10/2025
5.0.67 709 8/19/2025
5.0.66 192 8/19/2025
5.0.65 185 8/19/2025
5.0.64 186 8/19/2025
5.0.63 184 8/19/2025
5.0.62 341 8/18/2025
5.0.61 350 8/15/2025
5.0.60 446 8/6/2025
5.0.59 414 8/5/2025
5.0.58 283 8/5/2025
5.0.57 288 8/5/2025
5.0.56 263 8/5/2025
5.0.55 269 8/5/2025
5.0.54 407 8/4/2025
5.0.53 185 8/4/2025
5.0.52 480 7/28/2025
5.0.51 370 7/17/2025
5.0.50 461 7/14/2025
5.0.46 648 6/30/2025
5.0.45 210 6/30/2025
5.0.44 515 6/27/2025
5.0.43 304 6/27/2025
5.0.42 330 6/26/2025
5.0.41 321 6/18/2025
5.0.39 428 6/10/2025
5.0.38 314 5/30/2025
5.0.37 293 5/23/2025
5.0.36 381 5/14/2025
5.0.34 270 5/2/2025
5.0.33 312 4/28/2025
5.0.32 392 4/10/2025
5.0.30 341 3/15/2025
5.0.28 350 2/24/2025
5.0.27 706 2/12/2025
5.0.25 462 2/3/2025
5.0.24 359 1/30/2025
5.0.23 285 1/29/2025
5.0.22 347 1/24/2025
5.0.21 334 1/22/2025
5.0.20 323 1/16/2025
5.0.19 216 1/15/2025
5.0.15 288 1/13/2025
5.0.14 295 1/9/2025
5.0.13 510 12/17/2024
5.0.12 366 12/10/2024
5.0.11 196 12/10/2024
5.0.10 189 12/10/2024
5.0.9 266 12/9/2024
5.0.8 453 11/26/2024
5.0.7 180 11/26/2024
5.0.6 398 11/24/2024
5.0.5 193 11/24/2024
5.0.4 232 11/23/2024
4.0.218 317 11/20/2024
4.0.217 221 11/12/2024
4.0.216 397 11/11/2024
4.0.215 259 11/6/2024
4.0.214 333 11/5/2024
4.0.213 264 11/4/2024
4.0.212 291 11/1/2024
4.0.211 261 10/31/2024
4.0.210 267 10/30/2024
4.0.209 242 10/29/2024
4.0.208 340 10/25/2024
4.0.207 357 10/21/2024
4.0.206 319 10/16/2024
4.0.205 337 10/11/2024
4.0.204 267 10/10/2024
4.0.203 273 10/9/2024
4.0.202 365 10/2/2024
4.0.201 290 10/1/2024
4.0.200 309 9/30/2024
4.0.199 347 9/24/2024
4.0.198 311 9/23/2024
4.0.197 351 9/17/2024
4.0.196 360 9/10/2024
4.0.195 364 9/6/2024
4.0.194 383 9/3/2024
4.0.193 382 8/30/2024
4.0.192 283 8/29/2024
4.0.191 275 8/28/2024
4.0.190 288 8/27/2024
4.0.189 295 8/26/2024
4.0.188 309 8/23/2024
4.0.187 387 8/21/2024
4.0.186 547 8/16/2024
4.0.185 290 8/15/2024
4.0.184 311 8/14/2024
4.0.183 305 8/5/2024
4.0.182 284 8/2/2024
4.0.181 285 8/1/2024
4.0.180 383 7/26/2024
4.0.179 325 7/24/2024
4.0.178 359 7/11/2024
4.0.177 286 7/10/2024
4.0.176 194 7/10/2024
4.0.175 328 7/9/2024
4.0.174 451 7/5/2024
4.0.173 344 7/2/2024
4.0.172 410 6/27/2024
4.0.171 296 6/26/2024
4.0.170 385 6/24/2024
4.0.169 1,475 6/19/2024
4.0.168 293 6/18/2024
4.0.167 320 6/17/2024
4.0.166 325 6/14/2024
4.0.165 288 6/13/2024
4.0.164 430 6/3/2024
4.0.163 301 5/31/2024
4.0.162 297 5/30/2024
4.0.161 302 5/29/2024
4.0.160 515 5/27/2024
4.0.159 375 5/23/2024
4.0.158 381 5/21/2024
4.0.157 349 5/17/2024
4.0.156 278 5/16/2024
4.0.155 294 5/15/2024
4.0.154 340 5/8/2024
4.0.153 301 5/7/2024
4.0.152 302 5/6/2024
4.0.151 294 5/3/2024
4.0.150 1,016 5/2/2024
4.0.149 305 5/1/2024
4.0.148 308 4/30/2024
4.0.147 356 4/29/2024
4.0.146 328 4/25/2024
4.0.145 414 4/16/2024
4.0.144 333 4/12/2024
4.0.143 279 4/12/2024
4.0.142 300 4/11/2024
4.0.141 327 4/10/2024
4.0.140 292 4/9/2024
4.0.139 402 4/1/2024
4.0.138 340 3/29/2024
4.0.137 355 3/26/2024
4.0.136 324 3/22/2024
4.0.135 217 3/22/2024
4.0.134 388 3/18/2024
4.0.133 309 3/15/2024
4.0.132 289 3/14/2024
4.0.131 327 3/13/2024
4.0.130 324 3/11/2024
4.0.129 293 3/8/2024
4.0.128 261 3/7/2024
4.0.127 232 3/6/2024
4.0.126 231 3/5/2024
4.0.125 246 3/4/2024
4.0.124 1,757 3/1/2024
4.0.123 323 2/29/2024
4.0.122 204 2/28/2024
4.0.121 245 2/27/2024
4.0.120 462 2/26/2024
4.0.119 199 2/23/2024
4.0.118 227 2/22/2024
4.0.117 224 2/21/2024
4.0.116 231 2/20/2024
4.0.115 213 2/20/2024
4.0.114 1,071 2/19/2024
4.0.113 220 2/19/2024
4.0.112 345 2/16/2024
4.0.111 208 2/15/2024
4.0.110 246 2/14/2024
4.0.109 480 2/13/2024
4.0.108 308 2/12/2024
4.0.107 235 2/9/2024
4.0.106 367 2/8/2024
4.0.105 200 2/7/2024
4.0.104 199 2/7/2024
4.0.103 196 2/6/2024
4.0.102 1,029 2/2/2024
4.0.101 273 2/1/2024
4.0.100 207 2/1/2024
4.0.99 209 1/31/2024
4.0.98 206 1/30/2024
4.0.97 701 1/25/2024
4.0.96 280 1/24/2024
4.0.95 217 1/23/2024
4.0.94 1,733 1/16/2024
4.0.93 204 1/16/2024
4.0.92 316 1/15/2024
4.0.91 333 1/12/2024
4.0.90 202 1/11/2024
4.0.89 204 1/10/2024
4.0.88 713 1/8/2024
4.0.87 816 12/26/2023
4.0.86 203 12/26/2023
4.0.85 206 12/25/2023
4.0.84 549 12/22/2023
4.0.83 444 12/15/2023
4.0.82 217 12/14/2023
4.0.81 203 12/14/2023
4.0.80 232 12/13/2023
4.0.79 209 12/12/2023
4.0.78 1,186 12/11/2023
4.0.77 376 12/6/2023
4.0.76 371 12/5/2023
4.0.75 568 11/24/2023
4.0.74 410 11/21/2023
4.0.73 361 11/20/2023
4.0.72 259 11/20/2023
4.0.71 326 11/17/2023
4.0.70 786 11/16/2023
4.0.69 283 11/14/2023
4.0.68 414 11/9/2023
4.0.67 351 11/8/2023
4.0.66 289 11/7/2023
4.0.65 274 11/6/2023
4.0.64 310 11/3/2023
4.0.63 427 11/1/2023
4.0.62 191 11/1/2023
4.0.61 353 10/31/2023
4.0.60 331 10/30/2023
4.0.59 298 10/27/2023
4.0.58 306 10/26/2023
4.0.57 289 10/25/2023
4.0.56 291 10/17/2023
4.0.55 390 10/16/2023
4.0.54 416 10/12/2023
4.0.53 297 10/11/2023
4.0.52 341 10/5/2023
4.0.51 387 9/26/2023
4.0.50 415 9/22/2023
4.0.49 309 9/20/2023
4.0.48 288 9/19/2023
4.0.47 179 9/19/2023
4.0.46 365 9/18/2023
4.0.45 411 9/14/2023
4.0.44 317 9/13/2023
4.0.43 312 9/12/2023
4.0.42 346 9/11/2023
4.0.41 213 9/11/2023
4.0.40 298 9/11/2023
4.0.39 536 9/7/2023
4.0.38 323 9/6/2023
4.0.37 378 9/5/2023
4.0.36 219 9/5/2023
4.0.35 353 9/4/2023
4.0.34 408 9/1/2023
4.0.33 374 8/31/2023
4.0.32 353 8/30/2023
4.0.31 209 8/30/2023
4.0.30 378 8/29/2023
4.0.29 557 8/25/2023
4.0.28 481 8/23/2023
4.0.27 480 8/18/2023
4.0.26 334 8/17/2023
4.0.25 210 8/17/2023
4.0.24 214 8/17/2023
4.0.23 653 8/10/2023
4.0.22 358 8/9/2023
4.0.21 324 8/8/2023
4.0.20 241 8/8/2023
4.0.19 415 8/8/2023
4.0.18 504 8/7/2023
4.0.17 608 8/3/2023
4.0.16 535 7/26/2023
4.0.15 492 7/20/2023
4.0.14 516 7/18/2023
4.0.13 248 7/18/2023
4.0.12 243 7/18/2023
4.0.11 834 7/17/2023
4.0.10 254 7/14/2023
4.0.9 256 7/13/2023
4.0.8 238 7/13/2023
4.0.7 263 7/12/2023
4.0.6 258 7/12/2023
4.0.5 322 6/13/2023
4.0.4 1,676 1/30/2023
4.0.3 668 1/30/2023
4.0.2 674 1/27/2023
4.0.1 845 12/13/2022
4.0.0 652 12/12/2022
3.1.49 2,906 6/10/2022
3.1.47 1,985 4/20/2022
3.1.46 927 2/25/2022
3.1.45 2,191 1/11/2022
3.1.44 1,257 1/10/2022
3.1.43 1,272 10/12/2021
3.1.42 568 10/12/2021
3.1.41 1,904 6/17/2021
3.1.40 1,472 6/16/2021
3.1.39 1,328 6/16/2021
3.1.38 1,165 6/16/2021
3.1.37 874 6/15/2021
3.1.35 2,120 1/7/2021
3.1.34 1,574 12/16/2020
3.1.33 725 12/16/2020
3.1.32 1,388 12/14/2020
3.1.31 3,529 9/13/2020
3.1.30 1,913 6/19/2020
3.1.29 1,327 6/8/2020
3.1.28 2,697 5/12/2020
3.1.27 2,159 5/12/2020
3.1.26 1,677 4/28/2020
3.1.25 1,608 4/16/2020
3.1.23 1,529 4/16/2020
3.1.22 1,592 4/16/2020
3.1.21 1,307 4/15/2020
3.1.20 1,551 4/15/2020
3.1.19 1,614 4/14/2020
3.1.18 1,303 4/14/2020
3.1.17 777 4/14/2020
3.1.16 1,628 4/10/2020
3.1.15 1,635 4/10/2020
3.1.14 4,146 3/26/2020
3.1.13 1,662 3/26/2020
3.1.12 1,850 3/25/2020
3.1.11 1,318 3/25/2020
3.1.10 1,301 3/25/2020
3.1.9 1,789 3/25/2020
3.1.8 1,839 3/24/2020
3.1.7 2,510 3/21/2020
3.1.6 2,359 3/13/2020
3.1.5 1,346 3/13/2020
3.1.3 2,344 2/28/2020
3.1.1.2 771 2/28/2020
3.1.1 1,099 2/22/2020
3.1.0 1,363 2/21/2020
3.0.4 1,422 2/11/2020
3.0.3 1,089 2/11/2020
3.0.2 852 2/10/2020
3.0.1 1,826 1/9/2020
3.0.0 1,564 12/23/2019
2.0.18 2,865 6/19/2019
2.0.17 865 6/19/2019
2.0.16 2,373 4/17/2019
2.0.15 1,758 3/14/2019
2.0.14 927 2/22/2019
2.0.13 1,970 2/21/2019
2.0.12 905 2/21/2019
2.0.11 4,940 8/1/2018
2.0.10 2,007 8/1/2018
2.0.9 1,779 7/3/2018
2.0.8 2,318 6/26/2018
2.0.7 1,502 6/26/2018
2.0.6 2,103 6/14/2018
2.0.5 2,225 6/1/2018
2.0.4 2,520 5/22/2018
2.0.3 3,119 5/9/2018
2.0.2 2,747 2/15/2018
2.0.1 2,409 2/13/2018
2.0.0 3,201 1/2/2018
1.0.44 11,896 10/10/2017
1.0.42 1,280 10/10/2017
1.0.41 1,590 9/29/2017
1.0.40 4,710 9/19/2017
1.0.39 1,300 9/15/2017
1.0.36 1,282 9/15/2017
1.0.35 1,280 9/15/2017
1.0.34 3,695 7/3/2017
1.0.33 2,204 6/16/2017
1.0.32 2,195 6/16/2017
1.0.31 1,337 5/30/2017
1.0.28 2,071 5/30/2017
1.0.27 1,848 5/25/2017
1.0.26 2,109 5/24/2017
1.0.25 1,667 5/19/2017
1.0.24 1,356 5/19/2017
1.0.23 1,641 5/17/2017
1.0.20 1,451 5/8/2017
1.0.19 1,459 4/7/2017
1.0.18 2,084 3/22/2017
1.0.15 1,804 1/31/2017
1.0.14 1,456 1/24/2017
1.0.13 1,500 1/8/2017
1.0.12 1,467 1/6/2017
1.0.11 1,479 1/6/2017
1.0.10 1,437 1/3/2017
1.0.9 1,560 12/9/2016
1.0.8 1,392 12/1/2016
1.0.0 1,363 9/15/2017