Hi with following code I am retrieving a DataTable
from a List:
using (SPSite site = new SPSite("http://...")) { using(SPWeb web = site.OpenWeb()) { SPList oList = web.Lists.TryGetList("Serverliste"); if(oList != null) { DataTable dt = oList.Items.GetDataTable(); } } }
This works fine. My problem is that I only want to get custom ListFields. When working with Fields one can simply callFromBaseType
which will show if a Field is custom or not. The only value which seems right isIsCustomType
. Though it is listed under Not public members
, which makes it unaccessable via code for me, right?
Well a dirty approach would be to iterate through ListFields, match them with DataColumns and check whether they are custom or not.
Is there any clean, efficient solution for this? Is this possible using CamlQueries? If yes, how would that query look like?
Algorithmen und Datenstrukturen in C#: TechNet Wiki