what's the frequency of the letter "a" in:
q: getdatatable from splistitemcollection my question is regarding the use of datatable vs listitemcollection. basically i have a small solution, where i have to loop through the items in the list to verify if the items already exists or not.
at this time i'm doing like this, for every item i'm trying to add
libraryname.getitems(query).count >= 1

someone advised me to use getdatatable, basically datatable to only retrieve once the data from the sharepoint and then to use it instead ... would it be a better approach?
or is there even better?
secondly if i will use datatable dt = listitemcol.getdatatabel(); how can i then be able to retrieve data from the datatable what names will the columns have? internalnames or not?
is it also possible to do a query on datatable with where statement?
any input is appreciated.

a: the main difference between datatable and splistitemcollection is that your data in datatable isn't connected to any spweb or spsite objects. you can create spweb, get datatable, dispose web and you will be sure that you will not have any memory leaks or errors.  
you can select data from datatable using datatable.select method.
also if you want to ensure that field contains unique values you can just set enforceuniquevalues property for this field to true.

a: shkipper,
possible duplicate of the question is:
splistitemcollection and getdatatable method, this will answer your performance question!
if you use getdatatable(), columns will have internal names and while debugging you can hover datatable object and click dataview option to show complete data with columns!
you can first use spquery to get your filtered splistitemcollection and then use getdatatable to iterate through the items... and yes you can filter and sort directly through datatable and see dataview rowfilter syntax [c#]
i hope this helps

user
In that passage, there are one hundred and forty-two occurrences of the letter "a."
assistant