1
I have a Stored Procedure
which inserts different fields. But however there is that when inserted I want to pick and place on the screen.
It is entered into the database in the following way:
cmd.Parameters.AddWithValue("@numero", 0);
What’s happening inside the Stored Procedure is as follows::
IF @numero=0
BEGIN
BEGIN TRANSACTION
SELECT TOP 1 @ult_nr=nRequesicao FROM cabecalho
WHERE eliminado=0
ORDER BY 1 DESC
SET @ult_nr=@ult_nr+1
INSERT INTO cabecalho(nRequesicao,nomeEmpresa,colaborador,nota,local_entrega)
VALUES(@ult_nr,@empresa,@empregado,@obs_cab,@local)
INSERT INTO linhas(nRequesicao,quantidade,descricao,valor,observacoes)
VALUES(@ult_nr,@qtd,@produto,@valor,@obs_linha)
SELECT * FROM V_Requisicao
WHERE nrequesicao=@ult_nr
ORDER BY id
COMMIT
END
ELSE
BEGIN
INSERT INTO linhas(nRequesicao,quantidade,descricao,valor,observacoes)
VALUES(@numero,@qtd,@produto,@valor,@obs_linha)
SELECT * FROM V_Requisicao
WHERE nrequesicao=@numero
ORDER BY id
END
How can I get the last value and put it on a label?
Although it seems different I think the answer is the same: http://answall.com/a/94895/101
– Maniero
Do you want a Storedprocedure to display the value of an input parameter? That’s right?
– Thiago Lunardi