StoredProcedurePlus.Net
1.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package StoredProcedurePlus.Net --version 1.0.3
NuGet\Install-Package StoredProcedurePlus.Net -Version 1.0.3
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="StoredProcedurePlus.Net" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StoredProcedurePlus.Net --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StoredProcedurePlus.Net, 1.0.3"
#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 StoredProcedurePlus.Net as a Cake Addin #addin nuget:?package=StoredProcedurePlus.Net&version=1.0.3 // Install StoredProcedurePlus.Net as a Cake Tool #tool nuget:?package=StoredProcedurePlus.Net&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Here the very basic usages of the library will be demonstrated through the steps below.
- Put the connection string in web.config file with the name "DbString".
<add name="DbString" connectionString="Data Source=YourServerNameOrIp;Initial Catalog=YourDatabaseName;Integrated Security=True;" providerName="System.Data.SqlClient"/>
- Create a basic sample stored procedure in your database.
CREATE PROCEDURE SpHelloWorld
@MyName varchar(100) = NULL,
@MyMessage varchar(250) = NULL OUT
AS
BEGIN
SET NOCOUNT ON;
SET @MyMessage = 'Hello world ' + @MyName
END
GO
- Create a class which will represent the parameters of the stored procedures.
public class SpHelloWorldParams
{
public string MyName { get; set; }
public string MyMessage { get; set; }
}
- Create the class which will be representing the stored procedure in code. And implement the abstract setup method to configure the mappings.
public class SpHelloWorld : StoredProcedureManager<SpHelloWorldParams>
{
protected override void Setup(ProcedureConfiguration<SpHelloWorldParams> configuration)
{
configuration.Input.Maps(v => v.MyMessage).Out();
}
}
- Thats it then. You are good to go. Whenever and where ever you need to cal the stored procedure just call its Execute method and it will take care of everything for you.
SpHelloWorldParams param = new SpHelloWorldParams()
{
MyName = "<Your name>"
};
SpHelloWorld sp = new SpHelloWorld();
sp.Execute(param);
string msg = param.MyMessage; // The out parameters will be set in the mapped property and can be used from here.
The variable "msg" now should have the value
"Hello world <Your name>".
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- Microsoft.CSharp (>= 4.4.1)
- System.Data.Common (>= 4.3.0)
- System.Data.SqlClient (>= 4.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
For detailed release details read README.md file:
https://github.com/sknath25/StoredProcedurePlus.Net/blob/master/README.md