例如:数据表字段为id name sex day
      在dbgrid中只显示id name

解决方案 »

  1.   

    dbgrid的列手动增加,然后与其要显示的字段关联即可。
      

  2.   

    双击dbgrid
    增加column,然后编辑column的绑定字段id,显示标题编号
    增加column,然后编辑column的绑定字段name,显示标题名称
      

  3.   

    双击DBGRID后,手动加列,数据集控件中手动加列也可以
      

  4.   

    dbGrid上按右键,Column Editor,上面有个Add all fields,你把全部加进来,不显示的再删掉,嘿嘿
      

  5.   

    select id,name from table
    然后帮定该SQL 到dbgrid.
      

  6.   

    这些方法都很不错,还要问个问题,如果我要在dbgrid中添加两个表的字段,是添加每个表的部分字段,也这样操作就可以吗?
      

  7.   

    可以.select id,name,表B字段1,表B字段2 from table,表B where table.id =表B字段1然后帮定该SQL 到dbgrid.
      

  8.   


    或select id,name from table