0
我有一個存儲過程定義爲存儲過程的輸出參數的值如下來檢查重複的電子郵件的存在:錯誤在檢索
USE [SQL2008_850994_onebizness]
GO
/****** Object: StoredProcedure [dbo].[EmailExists] Script Date: 04/07/2013 15:14:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[EmailExists]
@EmailID Nvarchar(50),
@Success int output,
@msg varchar(50) output
AS
BEGIN
IF EXISTS(SELECT 1 FROM dbo.Membership WHERE EmailId = @emailID)
OR EXISTS(SELECT 1 FROM dbo.Allocation where [email protected])
begin
set @Success=6
set @msg='Duplicate Email found. Please try again.'
--Insert the records in the database
end
END
我檢索的值成功的C#代碼如下:
int returnVal = int.Parse(myCOmmand.Parameters["@Success"].ToString());
我收到錯誤消息「輸入值的格式不正確」。
有人能讓我知道是什麼導致了錯誤?