DataSet排序

 //排序
            if (ds != null && ds.Tables.Count > 0)
            {
                DataView dv = new DataView();
                dv.Table = ds.Tables[0];
                dv.Sort = "id asc";
                DataTable dts = dv.ToTable();

                DataSet dss = new DataSet();
                dss.Tables.Add(dts);
                return Connector.ToXml(dss);
            }

posted @ 2013-10-11 09:43  碧落京豪  阅读(203)  评论(0编辑  收藏  举报