Wednesday, July 28, 2010

Office 2007 Upgrade In 2003 server has failed SharePoint....


Monday I heard from one of our customer that their SharePoint site is not working and give an error like

"Server error: http://go.microsoft.com/fwlink?LinkID=96177". That's all it says....

So I was googling to find some thing useful to overcome this and there were lots suggestions online too.

Most of the suggessions were asking to Run SharePoint Product And Technologies Upgreade and then after that things should be ok.....

But SharePoint Product And Technologies Wizard was stucking at step 9 and It was running more than a whole day, but I didn't stop it and let it to run. But finally found it is not going to stop and I stoped it.

Then fortunately found blog post asking to run following command...

stsadm –o upgrade –inplace –url Central_Administration_URL –forceupgrade

And this did the the trick for me..... it saved my days of time...... . Thanks for orginal Poster again.

Lakmal

SharePoint Task List Form View Settings

In SharePoint Task, we are having three views, New Task View (Where you initiate a new task) , Edit Task View(Where you update an exsisting task) and Task Display View (Just View a Task Details). In each view, you will need, particular fileds to be viewed, but some fields no to be in there.

I was also having same senario to be implemented in our intranet, Some fileds won't need t0 be view New Task entering view, but those fileds need to be in task editing view and so on so on.

In case i found a usefull article which describes how to achieve that what I was looking for....

This is the link...

Regards

Lakmal Kankanamge


How to Upload Files to SharePoint Doc Library...

I found this code snippet from a SharePoint Forum thread, It is about How to upload Files into SharePoint Document Library Using SharePoint API. Credit Should to original developer.
using (SPSite siteCollection = new
SPSite(url))

{
using (SPWeb spWeb = siteCollection.OpenWeb())

{

SPList spList = spWeb.GetList(url);


string fileName = "XXXX";

FileStream fileStream = null;
Byte[] fileContent = null;
try

{
string docPath = XXXX; //physical location of the file

fileStream = File.OpenRead(docPath + fileName);

fileContent = new
byte[Convert.ToInt32(fileStream.Length)];

fileStream.Read(fileContent, 0, Convert.ToInt32(fileStream.Length));

spList.RootFolder.Files.Add(spList.RootFolder.Url + "/" + fileName, fileContent, true);

spList.Update();

}
catch (Exception ex)

{

}
finally

{
if (fileStream != null)

{

fileStream.Close();

}

}

}
Regards

Lakmal Kankanamge.

SharePoint Resourses..

These days, I'm experiencing the excellent of SharePoint and here it is few Sharepoint resources I found while I'm searching on

http://blog.sharepointhosting.com/Downloads/SharePoint-Tutorials.aspx
http://www.fpweb.net/sharepoint-hosting/free-sharepoint-tutorials.asp
http://www.sharepoint-videos.com/
http://blog.rafelo.com/2008/06/exposing-and-creating-hidden-sharepoint.html
http://blog.rafelo.com/2008/06/exposing-and-creating-hidden-sharepoint.html
http://www.sharepoint-tips.com/
http://sharepointobjectmodel.blogspot.com/
http://blogs.msdn.com/sharepoint/ - Microsoft SharePoint Team Blog
http://nathan.blenke.com/articles/creating_a_sharepoint_2007_theme/
http://msdn.microsoft.com/en-us/office/aa940989.aspx
http://www.worldofasp.net/tut/UpdatPanelError/Handling_and_Customizing_UpdatePanel_Errors_Gracefully_260.aspx
http://blog.visualstudioteamsystem.com/post.aspx?item=23 - SharePoint Development and Programming
http://rshelton.com/Tags/How%20to/default.aspx
http://msdn.microsoft.com/en-us/office/aa940989.aspx - Sharepoint Videos
http://office.microsoft.com/en-us/help/FX100485361033.aspx?pid=CL100605171033 - SharePoint Course with Audio Explanation.
http://www.slideshare.net/Magganpice/introduction-wss-3-and-moss-2007
http://blogs.msdn.com/sridhara/archive/2008/05/24/digging-into-why-sharepoint-navigation-apis-wouldn-t-work-on-sites-using-collaboration-or-publishing-site-definition.aspx - Navigation Programming
http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3 -- Integrate ASP.NET AJAX with SharePoint

http://www.toddbaginski.com/blog/archive/2007/12/26/how-to-programmatically-customize-site-navigation-in-wss-3.aspx - Customize Navigation

http://www.sharepointdevwiki.com/display/public/Where+to+start+with+SharePoint+Development -- Where to start sharepoint development

http://www.sharepointdevwiki.com/display/public/Creating+a+List+programmatically+using+the+object+model -- Sharepoint Code Snippet

http://www.sharepointkings.com/2008/08/create-custom-listviewwebpart.html - Customer List View

http://www.sharepointkings.com/

Web Service Examples
http://blogs.msdn.com/arpans/archive/2007/07/24/sharepoint-web-service-example-grabbing-wiki-content.aspx
http://blogs.msdn.com/ericwhite/archive/2009/01/06/getting-started-with-sharepoint-wss-web-services-using-linq-to-xml.aspx
http://www.csharphelp.com/archives4/archive602.html
http://www.developer.com/tech/article.php/3104621
http://www.sharepointdevwiki.com/display/public/SharePoint+Web+Services
http://www.infoq.com/articles/swanson-moss-web-services


Regards

Lakmal

How to Start SharePoint Development....

I found simple article on this, and it says essential you need to know as new comer for SharePoint development. Here I copied that and paste here, just to read when I need.


The core SharePoint Services platform is comprised of more than 3000 API's. The most fundamental of these are found in the Microsoft.SharePoint namespace. The classes in this namespace will be used in virtually every Web Part and application development effort, so this is a good place to start.

The four key classes you'll need to become familiar with first are SPContext, SPSite, SPWeb, and SPUser. The SPContext class represents the context of an HTTP request in SharePoint Services. The SPSite class represents a collection of sites, including the top-level site and all children sub-sites. The SPWeb class is used to represent a single site in SharePoint. And, the SPUser class is used to represent a single user. Using these classes together lets you access virtually all information about sites and users, both in and out of the current site context.

In most situations, you'll need to know in what site context your code is currently running. To obtain this information, use the following code:

SPWeb web = SPContext.Current.Web;

If you are interested in retrieving the current site collection, use this code:

SPSite siteCollection = SPContext.Current.Site;

And if you need to access a site collection for a different context, you can use the following approaches:

SPSite siteCollection = new SPSite( "http://yourdomain/sites/hr" );

or

SPSite siteCollection = new SPSite( siteGUID );

Many times you'll want to obtain the current user for the current site context. Give this a try:

SPWeb web = SPContext.Current.Web;
SPUser currentUser = web.CurrentUser;

If you want to use some of what we learned above in a custom Web Part development effort, your code may look something like the following:

protected override RenderContents( HtmlTextWriter writer )
{
// Obtain context of current site and user.
SPWeb web = SPContext.Current.Web;
SPUser user = web.CurrentUser;

// Display the current users name.
writer.WriteLine( "Greetings: " + user.Name );
}

Obviously, this is a very basic example, but I hope it gives you a clear idea of how to use the current site context to obtain information about the site and user for which your code is executing.

To Original Article

Regards

Lakmal Kankanamge