kwizcom banner advertisement

SPQuery Returns All of the Items

5:21 PM    ,
During a development project, calling SPQuery returned all items from list! Looks like it just ignored the filters we applied. SPList list = new SPSite ( "http://MySharePointSite" ).OpenWeb().Lists[listName]; SPQuery query = new SPQuery (); query.Query = "<Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">Test</Value></Eq></Where></Query>"; SPListItemCollection items = list.GetItems(query); Fix is: This above code returns all items in the list, but if you remove the <Query> tag all works fine: SPList list = new SPSite ( "http://MySharePointSite" ).OpenWeb().Lists[listName]; SPQuery query = new SPQuery (); query.Query = " <Query> <Where><Eq><FieldRef Name="Title" /><Value Type="Text">Test</Value></Eq></Where> </Query> ";   SPListItemCollection items = list.Ge
SPQuery Returns All of the Items SPQuery Returns All of the Items Reviewed by Salaudeen Rajack on 5:21 PM Rating: 5

Change PDF Icon in SharePoint

12:17 AM    , , ,
By default, SharePoint does not include PDF document file type icon. So we need to do the below changes to display the PDF icon for PDF files in our SharePoint environment. Here is how we can add PDF icon in SharePoint 2010: Download an appropriate icon for pdf document type. you can download pdf icon for SharePoint from http://www.adobe.com/misc/linking.html   Copy the downloaded PDF icon to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\images" (Dont forget to set the read, Read & Execute permissions to "Domain users" to that PDF icon file!) Open the docicon.xml from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\xml\docicon.xml Add an entry under     <ByExtension> node:    <Mapping Key=" pdf " Value=" pdficon_small. png "/> Once done, you will get the PDF icon in SharePoint library as in below screen: SharePoint 2010 displays PDF icon. Codeple
Change PDF Icon in SharePoint Change PDF Icon in SharePoint Reviewed by Salaudeen Rajack on 12:17 AM Rating: 5
Powered by Blogger.