Difference between Load() and LoadQuery() in SharePoint

SharePoint Client Object model has two methods, Load() and LoadQuery(), to retrieve data from SharePoint Server. Both methods are used to retrieve the data or objects you queried from the SharePoint Server. Let’s find out major differences between them.

Load() :

Load Method populates client objects that reside within the ClientContext instance that is directly with what it gets from the server, i.e a collection object like ListitemCollection.

Load Method collection object can be cleaned up by garbage collection only when client context object will be destroyed.

Example:

code

LoadQuery()

LoadQueryMethod returns the data completely in a new collection in IEnumerable.

Since LoadQuerycollection objects are separate from the ClientContext instance, it will be cleaned much more easily.

Example:

code