Today I have found a strange behavior of the SPQuery class. My code has the following structure: … After the first iteration, the SPListItemCollection items always contains the same items, although the Query property of the query has been changed in the bucle. To resolve it I have putted the initialization of the SPQuery inside the bucle: And now all works normally.
SPList list = web.Lists["MyList"];
SPQuery query = new SPQuery();
foreach (DataRow row in table.Rows)
{
query.Query = "<Where>Some CAML Query with a row dependant condition</Where>";
SPListItemCollection items = list.GetItems(query);
…
}
…
…
SPList list = web.Lists["MyList"];
foreach (DataRow row in table.Rows)
{
SPQuery query = new SPQuery();
query.Query = "<Where>Some CAML Query with a row dependant condition</Where>";
SPListItemCollection items = list.GetItems(query);
…
}
…
Thursday, November 22, 2007
SPQuery inside a foreach bucle
Publicado por Àlex en 10:42 AM 3 comentarios
Wednesday, November 7, 2007
A button to submit content to SharePointPedia
Try it on my page. With this simple code on your page you can add a button to submit the content to the SharePointPedia: <input alt="Submit to SharePointPedia.com" name="Button1" type="image" src="http://sharepoint.microsoft.com/Pedia/PublishingImages/SPP/topbar_logo_spd.gif" value="Submit to SharePointPedia.com" onclick="javascript:location.href='http://sharepoint.microsoft.com/pedia/pages/post.aspx?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)" /> Enjoy it!
Publicado por Àlex en 2:40 PM 1 comentarios
Monday, November 5, 2007
An easy way to change the SharePoint index file’s location
This solution is valid for these scenarios where a full crawl is not a problem. In these cases you can move the index stopping the Office SharePoint Search Service and starting it again. In the form to start it you will find a textbox to indicate the new location of the index file. Then you will need to assign the index server for each SSP and start a full crawl for each content source. Remember that during the processes the search results will be incomplete. After that I have some questions: To understand the key concepts of the search infrastructure I have read the chapter 17 (specially the page Choosing a Search Implementation Topology Model) of the Microsoft Office SharePoint Server 2007 Administrator's Companion. Related links:
https://blogs.pointbridge.com/Blogs/robinson_will/Lists/Posts/Post.aspx?ID=21 (move the index without a full crawl)
Publicado por Àlex en 5:09 PM 4 comentarios