求解答如何同时替换字段中的两个值?例如:select ID,Content,IsEnabled from tb_Test其中IsEnabled是bit类型字段我想在显示的时候显示出来的是 启用 or 不启用使用Replace方法只能处理0,1其中一个值不要说让我在程序中判断这个在查出来之后直接保存到DataSet中,并作为数据源直接绑定到DataGridView控件中通常绑定之后DataGridView显示出来的是数字0 OR 1很影响用户体验 

解决方案 »

  1.   

    select case IsEnabled when 1 then '启用' else '不启用' end as IsEnabled
      

  2.   

    Select id,Content,case when isEnabled=1 then '启用' else '不启用' end IsEnabled
    From tb_Test
      

  3.   

    select ID,Content, 
    case IsEnabled 
    when 0 then '启用'
    when 1 then '不启用'
    else IsEnabled 
    end
    from tb_Test
      

  4.   


    直接在select的时候判断就可以啦
      

  5.   

    select ID,Content,case IsEnabled when 1 then '启用' else '不启用' end as IsEnabled from tb_Test
      

  6.   

    请问各位 - - 那UPDATE的时候呢……
      

  7.   

    update的时候就正常操作就可以了,改成0或1均可
      

  8.   

    你不是只要显示么,update跟原来一样啊
      

  9.   

    原来不是REPLACE的函数,飘过...