I'm trying to make my SQL Server Stored Procedure work with the datagrid. It has many nullable parameters ( = @param or @param is null), and looking at the post here https://forum.radzen.com/t/storeprocedure-nullable-is-false/1261/7 it should be okay. But I get the error on run (error CS7036: There is no argument given that corresponds to the required formal parameter 'param' of 'ItInventoryDataService.GetSpEquipments(string, bool?, int?, int?, int?, int?, int?, string, string, string, string, string, string, string, string, string)' )
I've tried to add null to each parameter on the Invoke data source method using null, ${null}, etc. and with this it does run, but the grid is empty.
This should be a pretty easy one for you. In the forum post I linked to when opening this case, I was under the impression that Radzen recognized nullable parameters in stored procedures - obviously I must be confused. I've tried debugging, but the process seems to halt before returning anything of value - probably not doing that correctly either.
So, instead I'm sending the stored procedure the parameters as null to keep Radzen happy. Looks like this:
Indeed Radzen treats string and date parameters in a special manner and add quotes (to spare the user the need to do that). We should handle null as a special value and ignore it.
As a workaround I can suggest creating a page property for those parameters and setting it to null. Then use the page property as the stored procedure parameter value e.g. ${endUserName}. Another thing you can try is ${null} - this could fool the current implementation and prevent it from adding quotes.
That is correct. The only solution until we fix that issue is to use the code generation ignore list or create a custom method which invokes the stored procedure with the right parameters.
public partial class HomeComponent
{
public async Task<IQueryable<Models.Northwind.SalesByCategory>> GetSalesByCategory(string categoryName)
{
return await NorthwindService.GetSalesByCategory(categoryName);
}
}