I'm new to LINQ and am having a problem getting proper results from a simple (working) stored procedure that takes no parameters and returns a single Integer. When calling this sproc with LINQ its returnvalue is always 0. When run using tableadapter or directly on the sql server it works, returning 6 digit values like 120123.
Here is my LINQ code:
Dim MeetingManager As New MeetingManagerDataContext
Dim MeetingID As Integer = MeetingManager.NewMeetingID().ReturnValue
Here is the NewMeetingID procedure:
ALTER PROCEDURE [dbo].[NewMeetingID]
AS
SET NOCOUNT ON
BEGIN
BEGIN TRANSACTION
SELECT UniqueNumber
FROM tblTakeANumber
WHERE NumberID = 1
BEGIN
UPDATE tblTakeANumber SET UniqueNumber = UniqueNumber + 1
WHERE (NumberID = 1)
END
COMMIT TRANSACTION
RETURN
END
Am I missing someting?