Are you from SQL background ?
CREATE PROCEDURE CheckAuthantication(@UserId NVARCHAR(50) , @Password NVARCHAR(50))
BEGIN
DECLARE @IsAuthanicated NVARCHAR(5)
SET @IsAuthanicated='0'
SELECT @IsAuthanicated=1 FROM Users WHERE Userid=@Userid AND Password=@Password
IF @IsAuthanicated='0' THEN
SET @IsAuthanicated='False'
ELSE
SET @IsAuthanicated='True'
END IF
END
Now run this procedure on sql server and call this from your code and check for value if 'True' then authenticate user otherwise not
Accept and vote if helps otherwise revert back with queries
--RDB