引用 7 楼 bbwolf 的回复:C# code?123456789for(int i = t.Columns.Count - 1 ; i >= 0 ; i --){ foreach(DataRow r in t.Rows) { if(!r.IsNull(t.Columns[i])) continue; } t.C……
C# code?123456789for(int i = t.Columns.Count - 1 ; i >= 0 ; i --){ foreach(DataRow r in t.Rows) { if(!r.IsNull(t.Columns[i])) continue; } t.Columns.RemoveAt(i)……
for(int i = t.Columns.Count - 1 ; i >= 0 ; i --) { foreach(DataRow r in t.Rows) { if(!r.IsNull(t.Columns[i])) continue; } t.Columns.RemoveAt(i); }
这个datatable是如果生产的?是读取xml还是读取自数据库? 从根源上处理不是更好吗
引用 2 楼 iceMung 的回复:引用 1 楼 shawn_yang 的回复:select A,B from table1 能详细点吗,不是很明白你的意思 sorry,写错了,应该是select A,C from table1 其实就是说你用一个查询语句,只显示你要的列即可
引用 1 楼 shawn_yang 的回复:select A,B from table1 能详细点吗,不是很明白你的意思
select A,B from table1
110,538
社区成员
642,577
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧