标题:SQL语句执行的问题
取消只看楼主
girl0001
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:56
专家分:118
注 册:2010-7-17
结帖率:68.75%
已结贴  问题点数:20 回复次数:0 
SQL语句执行的问题
if((select COUNT(*) from MembershipCard where ClientNum=(select ClientNum from Client where ClientName='@ClientName')) <>0)
begin
SELECT Client.ClientName,MemType.MemTypeTitle,LimitUsers.LimitTitle,LimitUsers.GroupID,LimitGroups.GroupName
                            FROM Client INNER JOIN MemType ON Client.MemTypeNum=MemType.MemTypeNum
                            FULL OUTER JOIN MembershipCard ON Client.ClientNum=MembershipCard.ClientNum
                            INNER JOIN LimitUsers ON LimitUsers.LimitNum=Client.LimitNum
                            INNER JOIN LimitGroups ON LimitGroups.GroupID=LimitUsers.GroupID
                            WHERE Client.ClientName='@ClientName' AND MembershipCard.ConsumerPwd='@ClientPwd'
end
else
begin
SELECT Client.ClientName,MemType.MemTypeTitle,LimitUsers.LimitTitle,LimitUsers.GroupID,LimitGroups.GroupName
                            FROM Client INNER JOIN MemType ON Client.MemTypeNum=MemType.MemTypeNum
                            INNER JOIN LimitUsers ON LimitUsers.LimitNum=Client.LimitNum
                            INNER JOIN LimitGroups ON LimitGroups.GroupID=LimitUsers.GroupID
                            WHERE Client.ClientName='@ClientName'
end

这个语句在SQL管理器中执行有数据行返回,但在C#中执行时没有任何数据返回,不知道怎么回事?哪位大侠给解释下。。。
搜索更多相关主题的帖子: where 
2013-11-17 19:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-423682-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.165865 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved