![]() |
VOOZH | about |
dotnet add package CA.Blocks.SQLServerDataAccess --version 3.6.200
NuGet\Install-Package CA.Blocks.SQLServerDataAccess -Version 3.6.200
<PackageReference Include="CA.Blocks.SQLServerDataAccess" Version="3.6.200" />
<PackageVersion Include="CA.Blocks.SQLServerDataAccess" Version="3.6.200" />Directory.Packages.props
<PackageReference Include="CA.Blocks.SQLServerDataAccess" />Project file
paket add CA.Blocks.SQLServerDataAccess --version 3.6.200
#r "nuget: CA.Blocks.SQLServerDataAccess, 3.6.200"
#:package CA.Blocks.SQLServerDataAccess@3.6.200
#addin nuget:?package=CA.Blocks.SQLServerDataAccess&version=3.6.200Install as a Cake Addin
#tool nuget:?package=CA.Blocks.SQLServerDataAccess&version=3.6.200Install as a Cake Tool
👁 NuGet version (CA.Blocks.DataAccess)
👁 Build Status
This Package is a extension to the DataAccess Blocks targeting the Sqllite provider
Quick example
poco object
public class ExampleSysObject
{
public int Id { get; set; }
public string Name { get; set; }
public string XType { get; set; }
public DateTime CreateDate { get; set; }
}
The Data access class
public class YourDataAccessClass : SqlServerDataAccess
{
public YourDataAccessClass() :
base( new SimpleConnectionStringDataAccessConfig("Server=(local);Database=tempdb;Integrated Security = SSPI; TrustServerCertificate=True"))
{
}
internal string ReadSysObjectsOfTypeSql => @"
SELECT TOP 10 id as Id, name as Name, xtype as XType, crdate as CreateDate
FROM sysobjects
WHERE xtype = @xtype";
public IList<ExampleSysObject> ReadSysObjectsOfType(string xtype)
{
var cmd = CreateTextCommand(ReadSysObjectsOfTypeSql)
.WithParameter(xtype.ToSqlParameter("@xtype"));
return Execute(cmd).ToListOf<ExampleSysObject>();
}
public async Task<IList<ExampleSysObject>> ReadSysObjectsOfTypeAsync(string xtype)
{
var cmd = CreateTextCommand(ReadSysObjectsOfTypeSql)
.WithParameter(xtype.ToSqlParameter("@xtype"));
return await ExecuteAsync(cmd).ToListOf<ExampleSysObject>();
}
public async Task<IList<ExampleSysObject>> ReadSysObjectsOfTypeWithSqlBuilderAsync(string xtype)
{
var sqlBuilder = new SafeSqlBuilder();
sqlBuilder.AddSql($"SELECT TOP 10 id as Id, name as Name, xtype as XType, crdate as CreateDate FROM sysobjects WHERE xtype = {xtype:@xtype}");
// this will build a valid sql statement with full parementer support.
// the sql will be "SELECT TOP 10 id as Id, name as Name, xtype as XType, crdate as CreateDate FROM sysobjects WHERE xtype = @xtype}" with the xtype passed in as a parameter
return await ExecuteAsync(sqlBuilder.BuildSqlCommand()).ToListOf<ExampleSysObject>();
}
}
Calling the data access class
var instance = new YourDataAccessClass();
var results = instance.ReadSysObjectsOfType("U");
foreach (var o in results)
{
Console.WriteLine($"{o.Id},{o.Name},{o.Type},{o.CreateDate}");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.8.215-prerelease | 112 | 3/6/2026 |
| 3.7.212-prerelease | 123 | 1/15/2026 |
| 3.7.210-prerelease | 208 | 12/26/2025 |
| 3.6.207-prerelease | 227 | 12/4/2025 |
| 3.6.205-prerelease | 287 | 11/30/2025 |
| 3.6.202-prerelease | 212 | 11/27/2025 |
| 3.6.200 | 427 | 8/22/2025 |
| 3.6.199-prerelease | 215 | 7/27/2025 |
| 3.5.197-prerelease | 299 | 7/20/2025 |
| 3.5.195 | 1,026 | 5/14/2025 |
| 3.5.194-prerelease | 297 | 5/14/2025 |
| 3.5.192-prerelease | 183 | 5/3/2025 |
| 3.5.190-alpha | 253 | 4/13/2025 |
| 3.5.187-prerelease | 197 | 4/13/2025 |
| 3.4.172-prerelease | 161 | 11/29/2024 |
| 3.4.160 | 1,219 | 11/17/2024 |
| 3.4.159-prerelease | 163 | 10/24/2024 |
| 3.4.157 | 1,129 | 8/8/2024 |
| 3.4.156-prerelease | 164 | 8/4/2024 |
| 3.4.154-prerelease | 144 | 8/4/2024 |
v3.6
- Bump the Microsoft.Data.SqlClient to use 6.1
v.3.5
- Added build packages for .NET 9
- Added SafeSqlBuilder to help build on sql statements based on Interpolated String with full parameter support
- Add SqlParameterHelper to help build sets of Sqlparamters with out using all the vebose synatax of using ToSqlParameter()