2个DataTable 数据之间的合并 VB.NET

        Dim dtsells As DataTable
        Dim dtrents As DataTable         

        dtsells = DAL.SellsDAL.Getsells
        dtrents = DAL.RentsDAL.Getrents
        dtrents.Merge(dtsells)

        Dim dtNew As DataTable = dtrents.Clone                                //克隆一个table
        Dim drArr As DataRow() = dtrents.Select("", "DatePublished desc")    //  获取datarow,并排序

        For i As Integer = 0 To drArr.Length - 11 Step 1     循环获取1-10条数据
            dtNew.ImportRow(drArr(i))                  复制到新table 的DataRow里面
        Next
             Return dtNew

posted @ 2010-12-23 17:39  lice  阅读(1282)  评论(0编辑  收藏  举报