ibatis.net调用存储过程出现错误This SQL map does not contain a MappedStatement named IsUserNameExis 10
<prucedureid="IsUserNameExists"patameterClass="String"resultClass="Boolean">Exec[dbo]...
<prucedure id="IsUserNameExists" patameterClass="String" resultClass="Boolean">
Exec [dbo].[IsUserNameExists] #UserName#
</prucedure>
C#
public bool IsUserNameExists(string userName)
{
SecUtility.CheckParameter(ref userName, true, true, true, 0, "userName");
return SqlMapper.QueryForObject<bool>("IsUserNameExists", userName);
}
存储过程
USE [signin]
GO
/****** Object: StoredProcedure [dbo].[IsUserNameExists] Script Date: 07/19/2013 16:28:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[IsUserNameExists]
@UserName nvarchar(256)
AS
BEGIN
IF (EXISTS (SELECT [signin].[dbo].[User].* FROM [signin].[dbo].[User] WHERE [UserName] like '%'+@UserName+'%'))
RETURN(1)
ELSE
RETURN(0)
END
GO 展开
Exec [dbo].[IsUserNameExists] #UserName#
</prucedure>
C#
public bool IsUserNameExists(string userName)
{
SecUtility.CheckParameter(ref userName, true, true, true, 0, "userName");
return SqlMapper.QueryForObject<bool>("IsUserNameExists", userName);
}
存储过程
USE [signin]
GO
/****** Object: StoredProcedure [dbo].[IsUserNameExists] Script Date: 07/19/2013 16:28:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[IsUserNameExists]
@UserName nvarchar(256)
AS
BEGIN
IF (EXISTS (SELECT [signin].[dbo].[User].* FROM [signin].[dbo].[User] WHERE [UserName] like '%'+@UserName+'%'))
RETURN(1)
ELSE
RETURN(0)
END
GO 展开
展开全部
sqlmap配置有错误吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询