JLOrdaz.DapperDataMSSQL 1.0.0

dotnet add package JLOrdaz.DapperDataMSSQL --version 1.0.0                
NuGet\Install-Package JLOrdaz.DapperDataMSSQL -Version 1.0.0                
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="JLOrdaz.DapperDataMSSQL" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JLOrdaz.DapperDataMSSQL --version 1.0.0                
#r "nuget: JLOrdaz.DapperDataMSSQL, 1.0.0"                
#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 JLOrdaz.DapperDataMSSQL as a Cake Addin
#addin nuget:?package=JLOrdaz.DapperDataMSSQL&version=1.0.0

// Install JLOrdaz.DapperDataMSSQL as a Cake Tool
#tool nuget:?package=JLOrdaz.DapperDataMSSQL&version=1.0.0                

JLOrdaz.DapperDataMSSQL

The Class SQLDataAccess handling database operations within the application. This includes connecting to the SQL database, executing queries, and managing data retrieval and updates. Below is a brief overview of the key functionalities provided by this file:

Key Functionalities

  1. Database Connection:

    • Establishes a connection to the SQL database using connection strings.
    • Ensures secure and efficient database connectivity.
  2. Data Retrieval:

    • Executes SQL queries to fetch data from the database.
    • Maps the retrieved data to appropriate data models.
  3. Data Insertion and Updates:

    • Handles the insertion of new records into the database.
    • Manages updates to existing records ensuring data integrity.
  4. Error Handling:

    • Implements robust error handling to manage database-related exceptions.
    • Logs errors for debugging and maintenance purposes.

Example Usage

Here is a basic example of how to use the SQLDataAccess class to retrieve data:

// Create an instance of SQLDataAccess
SQLDataAccess db = new SQLDataAccess();

// Define a query to fetch data
string query = "SELECT * FROM Users";

// Execute the query and retrieve the results
var users = db.LoadData<UserModel>(query);

// Process the retrieved data
foreach (var user in users)
{
    Console.WriteLine($"User ID: {user.Id}, User Name: {user.Name}");
}

Dependencies

  • System.Data.SqlClient: Used for SQL database connectivity.
  • Dapper: (If applicable) Used for object mapping and query execution.

Configuration Ensure that the connection string is correctly configured in the application's configuration file (e.g., appsettings.json or web.config).

{
  "ConnectionStrings": {
    "DB": "YourConnectionStringHere"
  }
}
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 107 10/10/2024