我的数据库中有一个学历字段,因为涉及到排序,所以把一个字段设置成了数字
如:0--小学,  1--中学, 2--高中,  3--大专, 4--大本, 5--研究生
而我用dataGrid绑定后,学历这一字段显示却是1,2,3,4,5等这些数字.
而我想GridView里面此字段显示为中学,大专,应该如何作.谢谢了.
郁闷了好久了.
谢谢.
马上结贴.

解决方案 »

  1.   

    select *,(case ? when '0' then '小学' when '1' then '中学' when ........ when '5' then '研究生' as end) as 什么什么名字(你自己想) from ??? where ????
      

  2.   

    select *,(case 学历字段 when '0' then '小学' when '1' then '中学' when ........ when '5' then '研究生' as end) as 什么什么名字(你自己想) from ??? where ????
      

  3.   

    在sql里处理完就好了楼上应该可以
      

  4.   

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                if (e.Row.RowType==DataControlRowType.DataRow)
                {
                    if (e.Row.Cells[1].Text == "0")
                    {
                        e.Row.Cells[1].Text = "小学";
                    }
                    else if(e.Row.Cells[1].Text == "1")
                    {
                        e.Row.Cells[1].Text = "中学";
                    }
      

  5.   

    job_2006(初学.net)的方法我有点看不太懂.
    我用了jc15271149(嘿咻) 的方法.谢谢.