MyCrudPackage 1.2.0
dotnet add package MyCrudPackage --version 1.2.0
NuGet\Install-Package MyCrudPackage -Version 1.2.0
<PackageReference Include="MyCrudPackage" Version="1.2.0" />
paket add MyCrudPackage --version 1.2.0
#r "nuget: MyCrudPackage, 1.2.0"
// Install MyCrudPackage as a Cake Addin #addin nuget:?package=MyCrudPackage&version=1.2.0 // Install MyCrudPackage as a Cake Tool #tool nuget:?package=MyCrudPackage&version=1.2.0
Purpose
This package is useful to everyone who uses .net framework and try to push the model data to the sql database.
Implementation
we have 3 methods in this package
- DBTransaction - Applicable to send model as a parameter and do the CUD operations
- GetDataSet - Applicable to receive the dataset with multiple or single table (with and without model)
- GetDataTable - Applicable to receive the datatable (with and without model)
Scenario 1:
You want to do a transaction to create / update / delete a record
Here is your Model
public class Employee
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string MiddleName{get;set;}
public int Age{get;set;}
public bit Gender{get;set;}
}
Server side - Button_Click event
/* you are forming this object in your creation screen (Employee.aspx.cs) */
Employee employee=new Employee();
employee.FirstName=txtFirstName.Text;
employee.LastName=txtLastName.Text;
employee.MiddleName=txtMiddleName.Text;
employee.Age=Convert.ToInt16(txtAge.Text);
employee.Gender=Convert.ToBoolean(rbdGender.Value);
here is your connection string
string sqlconnectionstring=ConfigurationManager.ConnectionStrings["yourconnectionstring"].ConnectionString;
string storedprocname=<storedprocedurename>;
here we call our MyCrudPackage
var result=MyCrudPackage.CRUD.DBTransactions<Employee>(employee,storedprocname,sqlconnectionstring);
Scenario 2:
To receive data to a Dataset with parameters (multiple collection of select statement from stored proc / single)
DataSet ds=new DataSet();
ds=MyCrudPackage.CRUD.GetDataSet<Employee>(employee,storedprocname,sqlconnectionstring);
Scenario 3:
To receive data to a Dataset without parameters (multiple collection of select statement from stored proc / single)
DataSet ds=new DataSet();
ds=MyCrudPackage.CRUD.GetDataSet(storedprocname,sqlconnectionstring);
Scenario 4:
To receive data to a Datatable with parameters
DataTable dt=new DataTable();
dt=MyCrudPackage.CRUD.GetDataTable<Employee>(employee,storedprocname,sqlconnectionstring);
Scenario 5:
To receive data to a Datatable without parameters
DataTable dt=new DataTable();
dt=MyCrudPackage.CRUD.GetDataTable(storedprocname,sqlconnectionstring);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
This package has 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 |
---|---|---|
1.2.0 | 1,082 | 11/13/2022 |
Implemented new changes to get the dataset and datatable without any object