[SQL SERVER 2005] probleme basique
Bonjour, je suis tout nouveau dans cette tech', veuillez m'excuser pour cette question (d'avance)
j'ai une procedure stockee qui renvoie le max d'un champ d'une table:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
ALTER PROCEDURE KeysUpdate
(
@maxID integer = 0 OUTPUT
)
AS
BEGIN
SELECT @maxID = Max(CustomerID) FROM Customers
RETURN @maxID
END |
avec comme resultat :
Code:
1 2 3 4 5 6
| Running [dbo].[KeysUpdate] ( @maxID = <NULL> ).
No rows affected.
(0 row(s) returned)
@maxID = 16
@RETURN_VALUE = 16
Finished running [dbo].[KeysUpdate]. |
et mon code asp.net:
Code:
1 2 3 4 5 6 7
| myCommand5 = New SqlCommand("KeysUpdate")
myCommand5.Connection() = myConnection
myCommand5.CommandType = CommandType.StoredProcedure
Dim MaxID As Integer = Convert.ToInt16(myCommand5.ExecuteScalar())
lblError.Text = "MAX:: " + MaxID.ToString |
elle s'execute, mais me renvoie '0', desole je n'ai pas encore la connaissance pour voir d'ou vient le probleme, merci du coup de main ... ;)