Classic Microsoft Documentation

This is a very typical piece of microsoft documentation.

It contains the call interface, and a trivial example, yet has left the end user to identify the useful information that should be documented.  It appears that most of the MSDN api documentation has been autogenerated from the code.  Which is completely useless when the names give no clue.

I have been looking at using the WF rules engine outside of the WF framework.  This should be easy to do, yet the documentation sucks.  You end up having to hunt around various blogs &c.

Loading data into a Sharepoint page from a webpart file

/*

using System;

using System.Xml;

using Microsoft.SharePoint;

using Microsoft.SharePoint.WebPartPages;

*/

 

            try

            {

 

                using (SPSite site = new SPSite(“http://mysite:123456/“))

                {

                    using (SPWeb web = site.OpenWeb(“MySubWeb”))

                    {

                        SPFile targetPage = web.GetFile(“default.aspx”);

 

                        SPLimitedWebPartManager webpartManager = targetPage.GetLimitedWebPartManager(

                            System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);

 

                        string errMsg;

 

                        // This is the file that can be exported from the webpart

                        XmlTextReader reader = new XmlTextReader(“summary.webpart”);

                        System.Web.UI.WebControls.WebParts.WebPart webPart = webpartManager.ImportWebPart(reader, out errMsg);

 

                        webpartManager.AddWebPart(webPart, “TopWebPartZone”, 1);

                        targetPage.Update();

 

                    }

                }

 

            }

            catch (Exception ex)

            {

                Console.WriteLine(ex);

            }

PowerShell

Recently I have been experimenting with PowerShell.

I have a need to configure Sharepoint in a repeatable manner and have considered Powershell as a possible means of doing so.

Here is a site that provides basic PowerShell documentation

Here is a site that has 5 useful Sharepoint PowerShell functions.
The code is missing a reference to the assembly but that can easily be fixed.

This is a site that proves a sample script to recycle the app pool – something that you need to do very frequently in sharepoint development.

Windows Genuine Annoyance

I don’t mind running WGA once to download “free” software.

I do mind if you keep on having to run WGA.  Once I have genuine software how could it change?

It is especially annoying as the checks have now started to fail (despite this being a fully XP licensed machine).

How the BDC Columns actually work

This post explains how the BDC works under the hood.
It does however miss out on fully updating the underlying data – you need to update each BDC field explicitly.

The big flaw with the BDC is that the externally referenced data is cached in the list itself.  The user needs to update the list (which can be time consuming) or the host app must do it for the user.