我写了这个函数,现在它总是返回真......
有人可以帮助我吗?
Create FUNCTION dbo.ValidateBranch
(
@BranchID nvarchar(50),
@Password nvarchar(50)
)
RETURNS bit
AS
BEGIN
declare @Res bit
if exists(Select * From TPasswords Where (BranchID = @BranchID) and (isSecurity = 0) and (Pass = @Password))
set @Res = 1
else
set @Res = 0
RETURN @Res
END
我是这样称呼的:
bool isValidBranch = taQueries.ValidateBranch(IDBranch, PasswordTextBox.Text) ?? false;