我有一个字段在数据库中的值是这样的  '1','2' ... 'A'   .在DBGrid 中需要这样显示  '立项','批复' ... '评估' 
我在字段的GetText 事件里这么写:  提示栈溢出 是什么问题啊?
   if sender.Text='0' then
    Text :='立项';
   if sender.Text='1' then
    Text :='批复' ;
     ....
    if sender.Text='A' then
    Text :='评估' ;

解决方案 »

  1.   

    自己跟踪一下字段的GetText 事件,我记得仿佛是死循环的问题
      

  2.   

    改为
       if Text='0' then
        Text :='立项';
       if Text='1' then
        Text :='批复' ;
         ....
        if Text='A' then
        Text :='评估' ;
      

  3.   

    哦,搞错了,改为:
       if sender.AsString='0' then
        Text :='立项';
       if sender.AsString='1' then
        Text :='批复' ;
         ....
        if sender.AsStrin='A' then
        Text :='评估' ;
      

  4.   

    我找到答案了,这样就可以了
       if sender.AsString='0' then
        Text :='立项';
       if sender.AsString='1' then
        Text :='批复' ;
         ....
        if sender.AsString='A' then
        Text :='评估' ;
      哎,困扰了我好几天了,就是想不出来那里错了,还跟踪不到,(呵呵,有点菜) 
      虽然是自己搞定的,还是谢谢大家,一样给分
      

  5.   

    啊,谢谢DragonBill(月满西星) !!!
      

  6.   

    再问一个菜鸟级别的问题  ,将数据库中的字段类型为Datetime 的数据置空怎么写?
      

  7.   

    DragonBill(月满西星) is OK,通用的方法是if sender.Value='...' then ...