你的DataGrid是怎么绑定的,是模板列,还是自动生成的?模板列的话,属性生成器里有页眉文本

解决方案 »

  1.   

    "select ID 编号,Tname 姓名,...."
      

  2.   

    填充DataSet后:将datagrid的这个属性设成AutoGenerateColumns="true",然后:
    gatagrid.DataSource=dataset.table["tablename"].DefaultView;
    datagrid.DataBinder();
      

  3.   

    可以用sql语句把表的列取出来:
    describe select * from tablename;
    就可以选出tablename中所有字段的字段名,字段类型,字段长度.
      

  4.   

    检索系统表
    select coloumn_name from syscolumns where table_name='sfsdf'