PH.DALHelper 1.3.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package PH.DALHelper --version 1.3.1
NuGet\Install-Package PH.DALHelper -Version 1.3.1
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="PH.DALHelper" Version="1.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PH.DALHelper --version 1.3.1
#r "nuget: PH.DALHelper, 1.3.1"
#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.
// Install PH.DALHelper as a Cake Addin
#addin nuget:?package=PH.DALHelper&version=1.3.1

// Install PH.DALHelper as a Cake Tool
#tool nuget:?package=PH.DALHelper&version=1.3.1

<PH.DALHelper> - What's new in the latest version

Version <1.3> This is migrate from DALHelper to support .NET Standard 2.1 and .NET Framework 4.61

This is handle query, excute from MSSQL, Oracle, Access, MySQL just simple in one Library. The result can automatic map into your Model or your custom Mapper

How to install using nuget package

Install-Package PH.DALHelper

Listing your provider

// Retrieve the installed providers and factories.
DataTable table = DbProviderFactories.GetFactoryClasses();

// Display each row and column value.
foreach (DataRow row in table.Rows)
{
	foreach (DataColumn column in table.Columns)
	{
		Console.WriteLine(row[column]);
	}
}

Using with .net core / or your Provider is not Register in your system, we can register bellow:

We need to registry Provider before going below step: Example: OleDb

DbProviderFactories.RegisterFactory("System.Data.OleDb", typeof(System.Data.OleDb.OleDbFactory));

1. Using with Instance:

var db = new DB("Provider=sqlncli11;Server=sssssssssssssssss,NNNN;Database=AAAAAAAAAAAA;Uid=zzzzzzzzzz;Pwd=qqqqqqqqqqqqqqqqqqqqqqq;Connect Timeout=180;", 180);

2. Using via PH.DALHelper

This is simple, quickly and easy to use

var msqlConnection = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString();
msqlConnection.CreateInstance(180); // Just create one time on your application

// And we can query everywhere
// Execute Store Procedure with param is ID and list of Categories
var res = "sp_GETcategories ?".GetObjects(new object[] { id }, new CategoryMapper());

// Excute query 		
"sp_DELETECategory ?".Execute(new object[] { id });

// Excute SQL query
var res = "SELECT ID, NAME from Customers where ID=?".GetObjects(new object[] { id }, new CustomerMapper());

// StoreProc with output, for paging, etc
object total = null;
string query = "sp_GETaaa ?, ?, ?, ?, ?, ? OUTPUT";
var res = query.GetObjects<AAA>(new object[] { id, q, offset, pageSize, orderBy, 0 }, ref total, new AAAMapper());

3. How to create CustomerMapper

public class CustomerMapper : Mapper<Customer>
{
    public override Customer Map(IDataRecord record)
    {
        var cus = new Customer();
        var idx = -1;
        
        cus.ID = record[++idx].ToString();
        cus.Name = record[++idx].ToString();        
        
        return cus;
    }
}

MySQL can following

DbProviderFactories.RegisterFactory("MySql.Data.MySqlClient", typeof(MySql.Data.MySqlClient.MySqlClientFactory));
"MySql.Data.MySqlClient".CreateInstance("server=127.0.0.1;uid=root;pwd=SQL2019-SSEI-Expr.exe;database=classicmodels", 180);

// Example query
var res = "SELECT lastName, firstName, email FROM classicmodels.employees limit 100".GetObjects<Customer>(null, new CustomerMapper());
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated

Just handle MSSQL, Access, Oracle in one DLL. Support simple, quick query and mapper via DALHelper