Skip to main content

Disadvantages of CAML over LINQ in SharePoint 2010


Disadvantages of CAML:


Since CAML query is text based, If you are joining two lists accross a lookup field there may be various problems.
you do not know until run time if the query is written correctly. If the query is not correct, then it will simply fail at run time.
It has no IntelliSense support at design time.
When writing the query, you have no idea what CAML elements are legal in the syntax without having a reference open.
The query is difficult to read. You cannot determine easily what the query is doing and what lists are being joined.
The data returned from the query is placed in a SPListItem collection, which does not provide strongly typed business entities.

Advantages of LINQ over CAML:
It is an object-oriented query language.
It provides strongly typed objects at design time, you can create queries in code and know that they are correct because the code compiles.
The strongly typed objects provide IntelliSense at design time, which makes it much easier to construct a correct query.
The results are returned from queries as strongly typed objects, so the items and fields also provide IntelliSense and compile-time checking.

Comments

Popular posts from this blog

SharePoint Farm Installation

Windows Cluster : http://technet.microsoft.com/en-us/library/bb727114.aspx http://blogs.msdn.com/b/clustering/archive/2008/01/18/7151154.aspx SQL Cluster : http://clusteringformeremortals.com/2009/10/07/step-by-step-configuring-a-2-node-multi-site-cluster-on-windows-server-2008-r2-%E2%80%93-part-3/ Network Load Balancing http://www.jppinto.com/2009/05/install-and-configure-wlbs-nlb-on-windows-server-2008/ SharePoint 2010 Farm Installation http://www.khamis.net/blog/Lists/Posts/Post.aspx?ID=48

How to store the sharepoint List or List Item within the recycle bin of the site while deleting it programmatically ?

Whenever we delete a sharepoint list or list item from the User Interface it get stored within the recycle bin of the site. But when we delete it programmatically it get's deleted permanently. So what we can do to store the List or List Item within the recycle bin while deleting it programmatically ? Generally we use the list.Delete() or item.Delete() method to delete the list or item. Instead of using the Delete() method we can use the Recycle() method i.e list.Recycle() or item.Recycle(). This will store the item within the recycle bin.