SP 2007 MAX Limitations

Entity                        Max Permissible Size
Site Name                    128 characters
Site URL                 255 characters
Display name                 128 characters
Connection string                 384 characters
Email address                    128 characters
Version numbers                064 characters
Virtual Server Friendly Name            064 characters
SQL Database Name                123 characters
SQL Database Column                128 characters
SQL Database Table Name            128 characters
SQL Role Name                    128 characters
Server Name                    128 characters
Windows User Name                300 characters
Windows Password                300 characters
Dependencies per object            032 objects
Zone enumeration value            004 zones
Default SQL command timeout             300 seconds
Number of simultaneous
maximum number of simultaneous workflows that can be in memory executing code            015

“An unexpected error has occurred” : Debugging Sharepoint

Debugging SharePoint can be problematic at times, it does like to hide debugging information from you. Recently I got an error: “An unexpected error has occurred” with nothing written to log files, trace or the event log.

The solution is to change a single entry in web.config, by modifying the line…

<SafeMode MaxControls=“200“ CallStack=“false“…

to…

<SafeMode MaxControls=“200“ CallStack=“true“…

You will also need to set custom errors to ‘Off’ .

<customErrors mode=“Off“/>

You will no longer see the “An unexpected error has occurred” error page and instead you get a lovely ’standard ASP.Net error page’ with the stack trace and everything…development has got that little bit easier!!

HOW-TO:11:: WSS Current Number of Sites 0 after SQL Restore of Content DB

You restore a content db via SQL restore and attach it to another SharePoint web application via Central Administration “Add a content database” and for some reasone the “Current Number of Sites” is 0.

How to fix it:

1. Remove the content databases from the virtual server using SP Central administration.

2. Delete the row from [restore_db].sites table.

3. Re add the content database back to Virtual server using SP Central administration page.

You should see the sites.

HOW-TO:10::Access SP URL Query String from javascript

function queryString(parameter) {
  var loc = location.search.substring(1, location.search.length);
  var param_value = false;

  var params = loc.split(“&”);
  for (i=0; i<params.length;i++) {
      param_name = params[i].substring(0,params[i].indexOf(‘=’));
      if (param_name == parameter) {
          param_value = params[i].substring(params[i].indexOf(‘=’)+1)
      }
  }
  if (param_value) {
      return param_value;
  }
  else {
      return false;
//Here determine return if no parameter is found
  }
}

HOW-TO:8::Sharepoint Virtual Server : Not Administrable

When you check the list of Virtual servers on Sharepoint central admin site, sometime you can see virtual server is not administrable.

To fix it, just change the path of virtual directory path in IIS to some other new location (ex: c:\mysite) and reset the IIS. It will fix the Problem.

HOW-TO:3:: Enable Anonymous Access to Sharepoint 2007 site

Step1:

  • In the Central Administration site select “Application Management” either in the Quick Launch or across the top tabs
  • Select “Authentication Providers” in the “Application Security” section
  • Click on the “Default” zone (or whatever zone you want to enable anonymous access for)
  • Under “Anonymous Access” click the check box to enable it and click “Save”

NOTE: Make sure the “Web Application” in the menu at the top right is your portal/site and not the admin site.

You can confirm that anonymous access is enabled by going back into the IIS console and checking the Directory Security properties.

Step2:

Now the second part is to enable anonymous access in the site.

  • Return to your sites home page and navigate to the site settings page. In MOSS, this is under Site ActionsSite SettingsModify All Site Settings. In WSS it’s under Site ActionsSite Settings.
  • Under the “Users and Permissions” section click on “Advanced permissions”
  • On the “Settings” drop down menu (on the toolbar) select “Anonymous Access”
  • Select the option you want anonymous users to have (full access or documents and lists only)

Now users without logging in will get whatever option you allowed them.

Notes:

  • You will need to set up the 2nd part for all sites unless you have permission inheritance turned on
  • If you don’t see the “Anonymous Access” menu option in the “Settings” menu, it might not be turned on in Central Admin/IIS. You can manually navigate to “_layouts/setanon.aspx” if you want, but the options will be grayed out if it hasn’t been enabled in IIS
  • You must do both setups to enable anonymous access for users, one in IIS and the other in each site

HOW-TO:4:: Linking and Showing external sites on Sharepoint page.

Add two Content Editor Web Parts to the web part page.

In Web Part A add the following code:   

<iframe name=myframe src=http://www.msn.com></iframe>

In Web Part B add the following code: 

<li><a href=http://www.microsoft.com target=myframe>Microsoft</a>
<li><a href=http://www.msn.com target=myframe>MSN</a>
<li><a href=http://msdn.microsoft.com target=myframe>MSDN</a>

The net effect is that clicking a link in Web Part B causes it to display inside web part A.

HOW-TO:7::How to fix "The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again" – Issue

Recently we had to reinstall Sharepoint 2003 on of the old box. When we reinstalled and tried to attach the content database to the site, we got the following error:

The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again.

This is a weird error. Here is the way to solve the problem:

1.  Check the System Version number in the content database the one which you want to add.

2. Add a new content database and find the system version and compare it.

3. Update the MS Patches from the below URLs:

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

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

HOW-TO:1:: Unlocking locked SP Webpage

At the end of the web address, type in ?contents=1 This will take you to a page that will allow you to close a web part down if it is one that just locked you out

HOW-TO:2:: Minimize web parts by default instead of the normal expanded view

1. It can be achieved it by setting the ChromeState in your page_load. See the following sample:

  foreach (GenericWebPart gwp in WebPartManager1.WebParts) {
           /// find for all the webparts on current webpart page.
           /// and set the ChromeState of each webpart to Minimized.
           gwp.ChromeState = PartChromeState.Minimized;
       }
Above one will change the state of all the webparts in all zones.

To change only specific webpart’s states we can also use –

wpm = WebPartManager.GetCurrentWebPartManager(Page);

GenericWebPart gwpLeft = (GenericWebPart)wpm.Zones["Left"].WebParts[1]; // here we can specify the zone and the webpart in it to change the state.

gwpLeft.ChromeState = PartChromeState.Minimized;

 
Follow

Get every new post delivered to your Inbox.