LINQ to SELECT from lists collection

A neat bit of code to write out all lists at the Root Web level that are hidden!

using(SPSite site = new SPSite(http://phillau)

{

SPWeb web = site.RootWeb

var lists = from list in web.Lists.OfType<SPList>()

where list.Hidden == true

select list;

foreach(var list in lists)

{

       Console.WriteLine(list.Title);

}

}

Done!

Advertisements

User Code Host Service keeps stopping

I recently came across a this error a few times on different SharePoint 2010 environments. Initially, I came across the error “User Code Host Service is too busy…” , then I stopped and started the User Code Host service from Central Administration. This then caused the error message telling me that the there was “No available Sandbox code execution server  could be found”.

I then looked into the error logs and found some errors about the User Code Host service and Performance logging. I opened the SharePoint log file, and scrolled down to the bottom of the file. Then I did a CTRL+F for “Perf”. I then found the error relating to starting the code host service and how the service has stopped.

 

And NO, STOPPING AND STARTING THE BLOODY USER CODE HOST SERVICE IN CENTRAL ADMINISTRATION DOES NOT FIX THIS PROBLEM!

 

Resolution:

I came across these this fix that resolved the issue of the User Code Host Service keeps stopping:

         http://support.microsoft.com/kb/2021539

 

This KB Article below was already done, but might be helpful for you too.

http://support.microsoft.com/kb/2509267

Done.

Operation is not valid due to the current state of the object.

I came across this error today while attempting to update my WSP via Sharepoint Powershell console.

I have been working on creating calculated fields in xml and the requirement was to include the <= (less than or equal to) symbol in the schema. Because this didn’t work, I changed this symbol to &leq. When I atttempted to update the solution, this is the error I got in the powershell window

Operation is not valid due to the current state of the object.

I removed &leq; from the fields xml and list xml schemas and this fix the problem, but not the requirement.

 

But if you are ever working with fields, content types, or lists schemas and you come across this problem, the likely issue would be invalid symbols or syntax in the xml.

JavaScript Index Of

<html>

<body>

<input id=”hdnList” type=”hidden” value=”http://website1.com,http://website2.com,http://website3.com.au&#8221; />

</body>

<script type=”text/javascript”>

var urlArray = new Array();
var str = document.getElementById(“hdnList”);

urlArray = str.value.split(‘,’);

var strResult = “http://website2.com/search/subsite&#8221;;

var i = 0;

for(i = 0; i < urlArray.length; i++)
{

if(urlArray[i].indexOf(strResult) != -1 || strResult.indexOf(urlArray[i]) != -1)
{
alert(urlArray[i]);
}

}

</script>

</html>

Customise spell checker dictionary in SharePoint 2010

To add words to the dictionary spell checker, use these instructions :

http://manish-sharepoint.blogspot.com/2010/05/adding-custom-spellings-in-sharepoint.html

 

If the changes do not take effect, following these steps,

http://blogs.msdn.com/b/vijgang/archive/2009/07/23/changes-to-the-custom-dictionary-txt-file-are-not-taking-effect.aspx

 

Nexus S ICS update mobile internet and wireless not working

Yup, I was one of the impatient Nexus S owners who did not want to wait and decided to do the manual ICS update by downloading the ICS update via Andriod Police website and installing it.

And yes, Mobile Internet and Wireless internet was not working straight after I did the update.

BUT

I got it working 🙂 and it was easy !

Enable Mobile Internet

1.  Open the Dialler (click on the icon on the left hand bottom that looks like a phone)

2. Type *#*#4636#*#* into your phone

3. The Testing menu will open

4. Select Phone information -> select Run ping test and you should get an IO.Exception error

5. Scroll down the page and select Turn off Radio

6. The text on the button should turn to Turn on Radio. After this happens, select Turn on Radio

7. Scroll up the page and select Run ping test

8.  The following tests should result in a Pass: PingIpAddr, Ping Host Name (www.google.co.uk), and Http Client Test

9. Ensure Data enabled is ticked and the correct Access Point Names is selected under Mobile network settings

10. Open up a Internet Browser on your phone and navigate to a web site

11. Done!!!! 🙂 Merry Christmas !!!!!!!!!!!!!!!!!!!!!!!

 

Test Wireless

1.  Open the Dialler (click on the icon on the left hand bottom that looks like a phone)

2. Type *#*#4636#*#* into your phone

3. The Testing menu will open

4. Select Wi-Fi information

5. Select Wi-Fi status

6. Run ping test.

7. The following tests should now all Pass: Ping IpAddr, Ping Host Name (www.google.co.uk), HTTP Client test

8. Now exit the menu and turn on Wireless if you have not already and connect to the internet!

 

 

 

Outlook 2007: cannot open your default e-mail folders. The information store could not be opened

I came across this error in my development environment when I need to do some work with Outlook 2007. After installing it, I started up Outlook and ran through the configuration wizard. Because there was no exchange server in the development environment, I just put in dummy data into the values.

Here is were I went wrong. Outlook stored the dummy data I put into the  configuration wizard and every time I try to open up outlook, I would get a error message telling me that the Exchange server I provided does not exist or is not online.

I tried uninstalling and re-installing Office 2007 but still no-go.

Then I found out the Outlook settings had been saved to my machine!

The solution: Deleting  the Outlook profile stored on the machine brings back the initial Outlook configuration wizard the next time you open Outlook!

1. Go to Control Panel -> Mail (Do a search for mail in the top right search box)

 2. Select Profiles

3.  Select the Outlook profile that was created by the configuration wizard for you

4. Hit Remove!

5. Start Outlook from the Start menu

Done!