以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 想实现这么一个效果! (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=55754) |
-- 作者:heying325 -- 发布时间:2014/8/22 15:01:00 -- 想实现这么一个效果! 我有一个表,里面有很多重复的数据,如下图: 请问有什么好方法?不只是删除重复!
|
-- 作者:don -- 发布时间:2014/8/22 15:59:00 -- Dim dr1,dr2 As DataRow Dim cmd As New SQLCommand Dim dt1,dt2 As DataTable \'\'cmd.Connection Name = "region" \'据实填写 cmd.CommandText = "SELECT * From {AA}" \'据实填写 dt1 = cmd.ExecuteReader() dt2 =DataTables("AA") \'据实填写 dt2.StopRedraw dt2.DataRows.Clear For Each s1 As String In dt1.GetValues("编码") dr1=dt2.AddNew For Each dc As DataCol In dt2.DataCols If dc.name = "编码" Then dr1( dc.name ) = s1 Else dr2=dt1.Find("编码 = \'" & s1 & "\' And " & dc.name & " > \'\' ") If dr2 IsNot Nothing Then dr1( dc.name ) = dr2( dc.name ) End If End If Next Next dt2.ResumeRedraw
[此贴子已经被作者于2014-8-22 15:59:01编辑过]
|