强烈抗议:楼主常把应设置为整数的列设置为字符型
'''
Dim Da As DataTable = DataTables("样本")
Dim ls As List(of DataRow) = da.Select("班级 Is not null","班级")
Dim i,r,n As Integer
r =Da.Compute("Count(班级)","班级 Is not null")
r = -int(-r/3)
DataTables("排列表").DataRows.clear
Tables("排列表").Addnew(r)
For i =1 to 3
For n = 0 to r-1
Tables("排列表").Rows(n)("班级" & i) =Ls((i-1)*r+n)("班级")
Tables("排列表").Rows(n)("姓名"& i) = Ls((i-1)*r+n)("姓名")
Next
Next
[此贴子已经被作者于2008-12-9 11:14:05编辑过]