DATATABLE中数据如何筛选重复数据

string[] temp null;

                    sql= "select originalName from DelFileList order by id desc";
                    DataTable tb db.getTable(sql);
                    if (tb.Rows.Count 0)
                    {
                        //对重复的数据进行筛选
                        Hashtable ht new Hashtable();
                        foreach (DataRow dr in tb.Rows)
                        {
                            string dr["originalName"];
                            if (!ht.Contains(s))
                                ht[s] dr["originalName"];
                        }

                        temp new string[ht.Count];
                        ht.Keys.CopyTo(temp, 0);
                    }

posted on 2009-04-09 00:38  alon  阅读(786)  评论(0编辑  收藏  举报

导航