c#开发cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)["xz"]) == true){selected = true;}上面那个是条件
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/15 00:04:48
![c#开发cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)[](/uploads/image/z/3684646-46-6.jpg?t=c%23%E5%BC%80%E5%8F%91cast%28+%28case+when+b.pbproject_ID+is+null+then+1+else+0+end%29+as+bit+%29+as+if+%28Convert.ToBoolean%28this.grvQuery.GetDataRow%28i%29%5B%22xz%22%5D%29+%3D%3D+true%29%7Bselected+%3D+true%3B%7D%E4%B8%8A%E9%9D%A2%E9%82%A3%E4%B8%AA%E6%98%AF%E6%9D%A1%E4%BB%B6)
c#开发cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)["xz"]) == true){selected = true;}上面那个是条件
c#开发cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as
if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)["xz"]) == true)
{
selected = true;
}
上面那个是条件
c#开发cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)["xz"]) == true){selected = true;}上面那个是条件
cast( (case when b.pbproject_ID is null then 1 else 0 end) as bit ) as xz
这个是sql语句吧,cast()是用于转换数据类型的 如case('222' as int) 把字符串转换成整型
case when then是条件判断
整句的意思就是:
case when b.pbproject_ID is null then 1 else 0 end——当b.pbproject_ID为空数据时值为1,否则值为0
再用cast转换成bit类型的xz字段
if (Convert.ToBoolean(this.grvQuery.GetDataRow(i)["xz"]) == true)
就是把this.grvQuery.GetDataRow(i)["xz"]的值转换成布尔类型再判断是否为true,当为true时执行下面的变量赋值