DataTable dt = new DataTable(); //添加列 DataColumn Title = new DataColumn("Title", typeof(string)); DataColumn TitleLink = new DataColumn("TitleLink", typeof(string)); dt.Columns.Add(Title); dt.Columns.Add(TitleLink); //添加行数据 foreach (SPListItem item in items) { DataRow row = dt.NewRow(); row[Title] = item.GetFormattedValue("Title"); row[TitleLink] = SiteName + "/" + WebName + "/" + web.Lists[ListName].RootFolder + "/" + "DispForm.aspx?ID=" + item.GetFormattedValue("ID") + "&Source=" + SiteName + "/" + WebName + "/"; ; dt.Rows.Add(row); }