Wednesday, 29 September, 2010

SharePoint 2010 Upgrade - SQL 2008 DB attach error

Yes, finally I was ready to move some of my MOSS 2007 SharePoint sites to the SharePOint 2010 test environment after days of playing on the new ground. I choose the Database attach method. As a first step I made sure that I have SP 2 and October 2009 CU on my MOSS 2007 and ran the

stsadm.exe -o preupgradecheck

This step is very important don't skip it. After making sure all components of my MOSS 2007 will get migrated to SP 2010 farm. I detached the database from MOSS 2007 Database server and moved it over to SP 2010 database server, the database server is SQL 2008. Everything was smooth till this point. The moment I tried to attach the MOSS 2007 content database, I received an error  as shown below. I checked my permissions on the database server and found nothing wrong.

Later I realized that this is a bug with SQL management studio and I need to use TSQL to attach the database

USE [master]
CREATE DATABASE [WSS_Content_Databasename] ON
( FILENAME = N'E:\MSSQL\MSSQLSERVER.DB\Data01\WSS_Content_databasename.mdf' ),
( FILENAME = N'E:\MSSQL\MSSQLSERVER.DB\Data01\WSS_Content_databasename_log.LDF' )
if exists (select name from master.sys.databases sd where name = N'WSS_Content_databasename' and SUSER_SNAME(sd.owner_sid) = SUSER_SNAME() ) EXEC [WSS_Content_databasename].dbo.sp_changedbowner @loginame=N'sa', @map=false

Database attach went through fine after this and I had my first site migrated to SharePoint 2010 :-)

Friday, 24 September, 2010

Office Web Apps. Now you can embed Powerpoint or Excel spreadsheet in you blogs/websites/sharepoint site

One of my friend Kiran sent me this  and I thought it is worth sharing.

Microsoft Office Web apps team has released some new features one of the most interesting one being able to embed PowerPoint and Excel spreadsheets into your Sharepoint site/blogs/website. You can read more from here. A very good feature of this is you can update the source location of Spreadsheet/PowerPoint page and Sharepoint/webpage/blog automatically displays the updated file.

Monday, 20 September, 2010

Free SharePoint 2010 Training Videos for IT Pros's and Developers

A lot of people ask me for good SharePoint 2010 learning resources, like books videos etc., Here are couple of links I referred myself and are great for SharePoint Developers, IT Pros as well as Users of SharePoint 2010. Hope you find this useful, here we go.

SharePoint 2010 End  User Training Videos at

and did I tell you, you can download all these videos.

Tuesday, 14 September, 2010

Some cool features you will like on SharePoint 2010

As I started using my new SharePoint 2010 site, there are some cool features I liked and hope every user of SP 2010 will really appreciate these.

The first thing I noticed was the “Getting Started” links on the homepage

You don’t have to go to “Site Settings” to carry out those changes that you wanted to do as soon as you got your new site. Things like changing the site icon, theme are right here. Even the customize quick launch bar comes handy at any time.

The other feature I liked was the Library tools Ribbon that appears on the top of the page the moment you select the small check box on the “Shared Documents” web part

Cool isn't it

Sunday, 5 September, 2010

SharePoint 2010 Evaluation Virtual Machine Available for download

Altohugh this is coming a bit late on my blog, I thought it is still a good information to share, lot of my SharePoint frineds wanted to try out SharePoint 2010 right away without going through the hassels of setting up one, and here is the solution I pointed them all to 2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM). I hope this will be useful to my many more SharePoint friends out there!!

Tuesday, 3 August, 2010

Getting XML data from SharePoint list

Ever wondered how you can generate a XML file/data from a SharePoint list, Have you started to think on the possible code..wait!!, here is an easy solution.

Simply format the following string to form the request URL.

  • {0} – The URL to your site.  This could be the root web or a child site.
  • {1} – The GUID for your list. 
 Please refer the following MSDN article for a more detailed instructions

Kirk Evans Blog 

Simple isn't it. Now make use of the XML data wherever you want

Thursday, 22 July, 2010

Validate if date is between two dates

I had this unique request coming from a user, he was using a Sharepoint list which had two date fields. Let us asume these fields to be "Order Date" and "Processed Date". The user wanted to make sure people enter a valid "Processed Date" which lied between "Order Date" and "Todays Date". Now SharePoint by default does not any such field validation functionality.

I tried googling, but there was nothing readily available for SharePoint. The next thing came to my mind was using a Javascript snippet, but how do I add the snippet to the code was another challenge. Please read through the article below to understand how to go about this.

1. First task was to create a list for the customer which had "Order Date" and "Processed Date"
2. Once this is created I need to write a Javascript snippet which will make sure the Processed Date is in between "Order Date" and todays date(current date)

so here is it:

3. Now that the snippet is ready I need to find a way to include this to the "NewForm.aspx" and also to "EditForm.aspx", Initially I though of using SharePoint Designer to do this, but somehow though there could be an easier way. Finally after 3 days and sevral cups of tea I found that I can add a content editor webpart the "NewForm.aspx" and "Editform.aspx" page . Normally "Edit Page" option is grayed out for these pages. But there is a cheat to get in

Just append "ToolPaneView=2" to the end of the URL for example


4.Next step is to add a contet editor webpart to the bottom of the page and copy the javascript snippet to the source editor. Click on Save and Apply ok on the webpart properties menu. Thats it its done!!.

5. Now it is time for testing, first I tried to key in a "Processed date" before the "Order Date" and as you can see I got a pop up "The Processed Date should be between Order Date and Todays Date" Bingo!!

6. The second thing I need to test what happens if I choose a date later that todays date.

and as you can see in the above pictures, it worked!! . You can also use the same two validate date between two differrent dates other than today, just tweak the javascript.