| 发表于:2007-03-28 14:57:263楼 得分:0 |
ds1.enforceconstraints = false; xmldocument doc = new xmldocument(); doc.load(filename); xmlelement root = doc.documentelement; stringreader sr1 = new stringreader(root.outerxml); ds1.readxml(sr1); system.data.datacolumn dc = new system.data.datacolumn( "编号 ",system.type.gettype( "system.int32 ")); dc.autoincrement = true; dc.autoincrementseed = 1; dc.autoincrementstep = 1; ds1.tables[0].columns.add(dc); this.dg1.datasource = ds1.tables[0].defaultview ; this.dg1.visible = true; ds1.tables[0].columns[0].columnname = "温度 " ; ds1.tables[0].columns[1].columnname = "湿度 " ; ds1.tables[0].columns[2].columnname = "风向 " ; ds1.tables[0].columns[3].columnname = "风速 " ; 为什么我的datagrid上面编号那一栏的显示都是(null)???? | | |
|