Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 SharePoint 2010 中开发一个项目。
我的要求是从 SharePoint 列表中获取一个空的 DataTable,但其中包含列名。
.GetDataTable() 方法仅在有值时才返回。
所以基本上我需要一个数据表中的列表结构。
如果 GetDataTable 不检索列信息,这应该会给您一个空的数据表。
DataTable _dt = new DataTable(); foreach (SPField spf in _lst.Fields) { _dt.Columns.Add(spf.InternalName.ToString(), spf.Type.GetType()); }