Use Store Procedure

I try to execute a SQL Store Procedure to get just one INT value and set into a datagrid field previous to submit action in the templateForm, I'm doing this in the submit event

  1. Execute data source metthod with name "spxxxx"
  2. Set a property with name "NEW_ID" and his value ${result} (to get from spxxxxx)
  3. Here I have to set NEW_ID value to a field of a datagrid element it is going to submit, datagrid is ${grid0}, but i dont know how to do that, ${grid0.ID}==${NEW_ID}

First i get error "error cs0246 the type or namespace name 'spxxxx' could not be found" but maybe i will get another error for next steps hehehehe.

I didn't write any code for store procedure, just infer as an entitie.

Could you help me? I try to read some articles but all you have to write code from outside of radzen, Is it only way?

You shouldn't get such an error if the stored procedure is inferred normally with Radzen. Could you send us the SQL CREATE script of your database to info@radzen.com?

I restart radzen and inferred again, that message does not apper anymore, but How can I set in radzen output parameters with my sp, look this is a test sp:
ALTER PROCEDURE [dbo].[spObtenerFolioTipoActivo]
@Folio int OUTPUT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @NuevoFolio int
--consulto valor de folio
SELECT @NuevoFolio = cast(Valor AS int) + 1 FROM cConfiguracion WHERE Clave ='FolioTipoActivo'
--Actualizo con el valor que se obtendrá la aplicación
UPDATE cConfiguracion SET Valor = @NuevoFolio WHERE Clave ='FolioTipoActivo'
SELECT @Folio=@NuevoFolio
END

When I get my output value i want to set into a datagrid field in the submit event (the grid is already loaded)

You can use the Execute C# action and set the required property to the result of the stored procedure. Set the code to something like product.ProductID = ${result} where product is the name of the page property which Radzen has generated for your model and ProductID is the property of the model you want to set to the stored procedure result. You can use the generated code as a guideline.

Ok thks, one more question, the parameter section when i invoke datasource method it is just for input parameter or how can i configure an output parameter form my store procedure.

thanks Korchev

Parameter section is only for input parameters. Output values are obtained in the {result} variable. Store that value in page variables for further use.

As @Vinod_Pillai suggested you can use the ${result} implicit expression to access the output parameters. You can check the code which Radzen has generated for your stored procedure.