E
EdwardH
I have Sproc:
ALTER PROCEDURE [dbo].[cPicInvent]
AS
DECLARE @retid int
BEGIN
UPDATE cConfig
SET LastInventNo = LastInventNo+1
SELECT @retid = LastInventNo FROM cConfig
RETURN @retid
END
and to pull back a new Inventory No I am using code:
Dim paret As New SqlParameter("retid", Data.SqlDbType.Int)
Using invNo = New SqlCommand("cPickInvent", invConn)
invNo.CommandType = Data.CommandType.StoredProcedure
paret.Value = "retid"
paret.Direction = Data.ParameterDirection.ReturnValue
invNo.Parameters.Add(paret)
iV = invNo.ExecuteReader
Me.txtInvNo.Text = CStr(iV(0))
iV.Close()
End Using
I am getting message
"Connection has not been initialised"
Any pointers gratefully received.
ALTER PROCEDURE [dbo].[cPicInvent]
AS
DECLARE @retid int
BEGIN
UPDATE cConfig
SET LastInventNo = LastInventNo+1
SELECT @retid = LastInventNo FROM cConfig
RETURN @retid
END
and to pull back a new Inventory No I am using code:
Dim paret As New SqlParameter("retid", Data.SqlDbType.Int)
Using invNo = New SqlCommand("cPickInvent", invConn)
invNo.CommandType = Data.CommandType.StoredProcedure
paret.Value = "retid"
paret.Direction = Data.ParameterDirection.ReturnValue
invNo.Parameters.Add(paret)
iV = invNo.ExecuteReader
Me.txtInvNo.Text = CStr(iV(0))
iV.Close()
End Using
I am getting message
"Connection has not been initialised"
Any pointers gratefully received.