我在SELECT中有这个代码:
SELECT A.CompletedDate,
CASE
WHEN (@AdminTestId IS NULL AND @UserTestId IS NULL) THEN 0
WHEN (@AdminTestId = temp.AdminTestId AND @UserTestId = A.UserTestId) THEN 1
WHEN (@AdminTestId = temp.AdminTestId AND @UserTestId IS NULL) THEN 1
ELSE 0
END AS [Current],
Run Code Online (Sandbox Code Playgroud)
在我的ASP.NET DTO中我有:
public partial class GetTestsDTO
{
public bool? GradePass { get; set; }
// the following line is what is giving the error. If I remove
// the line it will not try to convert the data and there is …Run Code Online (Sandbox Code Playgroud) 好的,我正在尝试从存储过程中返回BIT常量.
我设法让它编译的唯一方法是使用强制转换:
CAST(0 AS BIT) AS MyBool
没有演员表是否有更有效的方式来写这个?