Archive for September, 2010

09/30/10
Fahad Zia
tags:  

Lists.asmx GetListItems dataset does not include empty column


To better explain this, lets say i have a list with the following columns:

Department, Position
IT, Senior System Administrator
IT, Junior Programmer
HR,

using GetListItems on this list will include ows_Position node (provided that the CAML query does not have any filters for this example so its a SELECT * ) but now if the same list and query has no data in Position column:

Department, Position
IT,
IT,
HR,

the GetListItems will NOT have ows_Position node.
I recently came across this issue when reading values from a list that had an empty column and after converting the GetListItems to a dataset the datatable would not have this empty column listed

09/28/10
Fahad Zia

ProcessBatchData: Value does not fall within the expected range


This may apply to other funtions that use xml file but in my case i was using ProcessBatchData with correctly formatted xml string as the argument (atleast thats what thought since I could open the xml string fine in IE and Visual Studio debugger). After hours of debugging and googling i found out that it was because i was using single quotes in xml declaration!:
Wrong :

string strXML = "<?xml version='1.0' encoding='UTF-8'?>"

Correct:

string strXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" 

Page where i found this:
http://pholpar.wordpress.com/2010/02/05/how-to-change-the-order-of-the-fields-on-a-sharepoint-form-using-code/