rivantsov / vita

VITA Application Framework
MIT License
59 stars 15 forks source link

Execute Stored Procedures using Vita, #230

Closed rubenalves closed 1 year ago

rubenalves commented 1 year ago

I have a SP to update a value in a table, how can i execute it and pass values to the stored procedure? using ExecuteNonQuery ?

My SP is this

CREATE PROCEDURE UpdatePrecoByID @ID UNIQUEIDENTIFIER, @PVP DECIMAL AS BEGIN UPDATE LinhasPedidosPOS SET Preco = @PVP WHERE ID = @ID; END;

Can you give me a idea, is it lique this?

EXEC UpdatePrecoByID @ID = 'C6732362-17DA-47DF-9BE4-00B5F74D51E7', @PVP = 10;

Sessao.ExecuteNonQuery($"EXEC UpdatePrecoByID @ID = '{linha.ID}', @PVP = {Preco};");

Thanks.