Thursday, May 26, 2011

How To add a pdf icon in Sharepoint sites

So, Why not pdf icons are included in sharepoint?
Let the answer be unspoken.
but how to add that, so when we create a doccument library, icon will appear when we upload a pdf file?

So here we go with steps.

1)Copy pdf_smallicon from adobe site.
2)Open 12\Template\Images folder
3)Paste it in that.
4)open Docicon.xml file which is over here : 12\Template\XML\Docicon.xml
5)Go to tag
6)Add this


7)Thats all, go ahead upload any pdf file now and see the magic...

LINQ to Sharepoint 2010.

LINQ (New Data Access Paradigm), when i hear it for the first time, i was sitting in a seminar and dotnet geeks were giving long lectures on it.It will make developer's life more easy.....

LINQ is a new data access paradigm which allows users to express SQL like syntax against a variety of data sources. LINQ can improve performance by allowing the back end data source to decide the best way to solve the query.
Was Amazed when used it in 2007 days for filtering CAML returned data.

CRUDQ options were allready there for maiking things good for us. but still there was something easy to implement was missing.

And finally with 2010 Microsoft given us LINQ to SharePoint.
Namespace Microsoft.SharePoint.Linq.

For people who are wondering , what is the use of it when we have CAML and more things availlable.

So for those the answer i have is its very fast, Even perform all CRUDQ options, you can bring data from multiple List and as well its very easy to write and intelliscence support we have for gettting the column names and more of the things for which we struggled alot in past looking deeper in internal names of the columns ows_xyz...

SharePoint now fully supports LINQ for querying lists so that you can query information from the platform in a more condensed, easier to understand format.



SPMETAL, the new command line utillity we have for providing the basic structure for LINQ.

In this Post i will be sharing my own experience of working with it and using LINQ to SHAREPOINT.

Writing LINQ queries are very easy but tricky things comes with SPMETAL generated code and how to use SPMETAL utillity and usage of Parameters.xml as parameter file in the command line and as well the way of utillizing the data fetched by LINQ query on EntityList.

First we will take the brief on how LINQ does the Processing(building CAML in the background and then we will come to SPMETAL and way to create the code using Parameter.xml and also i will take the case what if some fields doesnt appear the code file,how to do hard fixing(the term i normally say) )

Next i will explain, how to query with scope recurssive when querying Document Library for Folders.

In the end i will explain how to bind the data to a GridView with Template Columns to the Ienumerable list of data returned by LINQ query.