Dim cmd As New SQLCommand
Dim dt As DataTable
Dim lst As WinForm.Table = e.Form.Controls("Table1")
cmd.ConnectionName = "cwgl"
cmd.CommandText = "SELECT * Fr om {Users}"
dt = cmd.ExecuteReader()
If lst.Table.Cols.Count>=0 Then
DataTables("users").sqlDeleteFor("[yhbm] = '" & lst.Table.Current("用户信息_用户账号") & "'")
DataTables("users").DeleteFor("[yhbm] = '" & lst.Table.Current("用户信息_用户账号") & "'")
End If
Dim bd1 As New GroupTableBuilder("统计表1", dt)
bd1.Groups.AddDef("yhbm","用户信息_用户账号") '根据根据用户账号分组
bd1.Groups.AddDef("name","用户信息_用户姓名") '根据用户姓名分组
bd1.Groups.AddDef("dwmc","用户信息_所属部门") '根据所属部门分组
bd1.Groups.AddDef("group","用户信息_用户角色") '根据用户角色分组
Tables("用户管理_Table1").DataSource = bd1.BuildDataSource()
Tables("用户管理_table1").AutoSizeCols() '设置自动列宽