比如“10102022”转换成“二级管理员”显示出来?

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=F73EF6AD-6878-4748-B963-5181252E5AED
      

  2.   

    SQL:
    select case when lie='10102022' then '二级管理员' end from tableorc:
    select decode(lie,'10102022','二级管理员','') from table
      

  3.   

    <%# (DataBinder.Eval(Container, "DataItem.VoteCount").ToString() == "10102022") ? "二级管理员":"二级管理员" %>
      

  4.   

    http://community.csdn.net/Expert/topic/3500/3500945.xml?temp=.1822779
      

  5.   

    可以在SQL中实现,也可以在databound事件中实现。
      

  6.   

    在datagrid帮定中<%#format(“10102022”)%>public string format( object source)
    {
    return "二级管理" ;
    }
      

  7.   

    SQL:
    select case when lie='10102022' then '二级管理员' end from tableorc:
    select decode(lie,'10102022','二级管理员','') from table
      

  8.   

    在sql中可以实现,如楼上,
    也可以在grid事件中实现!
      

  9.   

    我知道的三种方法:1、SQL语句中2、在Item_DataBound中写一下也可以if (e.Item.Cells[yourposition].Text == "0")
    {
        e.Item.Cells[yourposition].Text = "系统管理员";
    }
    else if (e.Item.Cells[yourpositon].Text == "1")
    {
        e.Item.Cells[yourposition].Text = "别的";
    }3、使用模板列
    前台:
    <asp:TemplateColumn HeaderText="身份">
    <ItemTemplate>
    <asp:Label ID="p" Text='<%#zhuangtai_deal(DataBinder.Eval(Container.DataItem, "status").ToString())%>' Runat =server > //status是你数据库中表示权
    </asp:Label>                                                             限的字段
    </ItemTemplate>
    </asp:TemplateColumn>后台:
    protected string zhuangtai_deal(string status)
    {
    if(status=="0")     
    return "系统管理员";
    else
    return "别的";
    }