Save $100 with promo code CHEERS2025

As we are looking forward to an incredible 2025, enjoy our end-of-year promotion! Valid now through January 6th.

See Pricing

Still using Radzen Studio?
Achieve more with Radzen Blazor Studio

Radzen Blazor Studio is our new flagship product and vision of how rapid Blazor application development should be done.

Go to Radzen Blazor Studio

Stored procedure default parameter value (Blazor)

This guide demonstrates how to set stored procedure default parameter value.

Step by step

1. Create new application with .NET server-side project and add new MSSQL data-source connected to Northwind database and check stored procedures.

Stored procedures execution can be customized using partial classes and methods.

2. Create NorthwindService partial class, provide default value for CustomerID parameter for OnCustOrderHistsDefaultParams method and filter the result. Set default value for parameters

public partial class NorthwindService
{
    partial void OnCustOrderHistsDefaultParams(ref string CustomerID)
    {
        CustomerID = "AROUT";
    }

    partial void OnCustOrderHistsInvoke(ref IQueryable<CustOrderHist> items)
    {
        items = items.Where(i => i.Total > 25);
    }
}

3. Invoke getCustOrderHists on button click without parameter and bind DataGrid to result.

4. Run the application