Skip Ribbon Commands
Skip to main content
View Cornelius J. van Dyk's profile on LinkedIn
 

 Posts

 
October 01
Honored to receive the Microsoft Most Valuable Professional award for SharePoint for the 8th time

I was honored today when Microsoft awarded me the Most Valuable Professional award for SharePoint, for the 8th time.  Here's to an especially great year ahead with SharePoint 2013!

Later
C

image

September 07
The SharePoint Versions list has been updated with the Aug 2012 CUs

The latest CUs have been added to the SharePoint versions list for both 2007 and 2010.

http://aurl.to/v

Later
C

image

September 04
How do I - Identify the SharePoint site template type and ID of a given sub web?

This one always comes up at some point in time, especially after migrations.  I've seen issues with migrated sites many times when custom site templates were used for sites, since SharePoint doesn't know how to upgrade these sites 100%.  A good example is the Fab40 templates that people loved to install in SharePoint 2007.  When migrating to 2010, the templates are not supported and if the templates were not installed on the target server, issues will arise with the sites.  The most common of these are that the home pages will simply throw a 404 error.  You can navigate through the site settings pages just fine, but the home pages just doesn't work.  For this reason, I always start my trouble shooting by asking what type of site I'm dealing with.  Since it's most unlikely that your site admin would know in most cases, it becomes necessary to be able to identify that.  Here's a quick Powershell script for doing so.

$web = Get-SPWeb "http://sharepoint.crayveon.com/Research/Encryption Algorithms"
write-host "Template Name: " $web.WebTemplate
write-host "Template ID: " $web.WebTemplateId
$web.Dispose()

NOTE:  The URL supplied to Get-SPWeb should be in quotes and should NOT contain unescaped characters i.e. http://sharepoint.crayveon.com/Research/Encryption%20Algorithms will NOT yield a valid SPWeb object, but "http://sharepoint.crayveon.com/Research/Encryption Algorithms" will.

Enjoy
C

image

August 16
How do I - Install Windows 8 RTM

I just posted my video showing the install experience of Windows 8 RTM that became available for download this morning.

http://youtu.be/otD1MewT8Os

Enjoy!
C

image

August 16
Windows 8, Visual Studio 2012, TFS 2012 and more NOW available for download!

If you have a MSDN or TechNet subscription, then you can now download the final RTM bits for these awesome products:

Windows 8

Visual Studio 2012

Team Foundation Server (TFS) 2012

.NET Framework 4.5

Now go get it and start building your Windows 8 based developer rigs!

Later
C

image

August 15
How do I - Programmatically select a field inside InfoPath XML using C#

As we know, InfoPath forms are actually XML documents behind the scenes... a special kind of XML, but XML nonetheless.  As such we should be able to figure out how to change the value of a field pretty easily, right?  You'd think so, but unless you live inside XML every day (so few of us do these days) it might now be as easy as you'd have thought.  After getting the InfoPath document loaded to an XmlDocument object, one would expect a statement thus:

doc.SelectSingleNode("//my:Family", nsm).InnerText = "New Value";

to have the desired effect.  Alas, it's not that simple.  It never is, is it? Smile  Instead, this is what you're greeted with:

image

What we need to do is ensure that your XmlNamespaceManager is properly assigned with the content from the given InfoPath form in order to translate the "my:" part of our xPath statement.  If we take a look at the InfoPath document's OuterXml value we see this:

<my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" 
             xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" 
             xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" 
             xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" 
             xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" 
             xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" 
             xmlns:tns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" 
             xmlns:s1="http://microsoft.com/wsdl/types/" 
             xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/directory/" 
             xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
             xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
             xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
             xmlns:ns2="http://schemas.xmlsoap.org/wsdl/soap/" 
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
             xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-02-03T15:25:24"
             xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-US">
  <my:Family>
    <my:InspectionDate>
      2012-03-16T00:00:00Z
    </my:InspectionDate>

With so many xmlns attributes in the InfoPath document, we need some automation to prepare our XmlNamespaceManager so we can interact with the data properly.  Adding this little code snippet to our existing code, should resolve that nasty error:

foreach (XmlAttribute att in doc.DocumentElement.Attributes)
{
  if (att.Prefix == "xmlns")
  {
    nsm.AddNamespace(att.LocalName, att.Value);
  }
}

Remember to create the XmlNamespaceManager object with a reference to the base XmlDocument's NameTable thus:

nsm = new XmlNamespaceManager(doc.NameTable);

Throw all that together and we are now able to manipulate the InfoPath field programmatically to our heart's content.  Smile

Later
C

image

August 07
SharePoint Fundamentals - How do I programmatically get a reference to a SharePoint site following Best Practices using C#

This is one of the most fundamental building blocks for all SharePoint developers.  We get references to SPWeb and SPSite objects all the time without ever giving a second thought to how it's done.  I've decided to document the recommended way to do this, combining guidance I frequently provide to SharePoint admins with regard to dealing with developer code via the Developer Dashboard.  This little snippet is thus intended to start guiding developers towards making it a habit to wrap sections of code in the SPMonitoredScope class.  I have provided the complete namespace of objects for completeness sake. 

A reference to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.dll is required.

Here's the code:

using (new Microsoft.SharePoint.Utilities.SPMonitoredScope("ScopeName"))
{
  using (Microsoft.SharePoint.SPSite sps = new Microsoft.SharePoint.SPSite("SiteURL"))
  {
    using (Microsoft.SharePoint.SPWeb spw = sps.OpenWeb())
    {
      //Do something
    }
  }
}

 

image

July 20
I am speaking at SPTechCon Boston next week

I'll be speaking at SPTechCon in Boston next week so if you're in the area, stop by and say hi.  My sessions are as follows:

SUNDAY 7/22/2012 @ 13:45-17:00

SharePoint Disaster Avoidance Architecture for Large Scale Enterprises

TUESDAY 7/24/2012 @ 08:30-09:45

SharePoint Performance: Best Practices from the Field

WEDNESDAY 7/25/2012 @ 11:30-12:45

Battle-scarred but still standing: A SharePoint Admin's tell-all

WEDNESDAY 7/25/2012 @ 13:45-15:00

Heavy Metal PowerPivot Remastered

 

The event is being held here:

The Westin Copley Place Hotel
10 Huntington Avenue
Boston, MA, USA 02116
Phone: +1-800-WESTIN1 ( 1-800-937-8461 ) 
Fax: +1-857-243-6910
http://www.westincopleyplaceboston.com/

 

Later
C

imageimage

July 19
SharePoint Versions List updated... now also with 15/2013 numbers!

I have updated the SharePoint Versions List with the latest addition to the family… SharePoint 2013 Preview numbers!  Spread the word.  The versions list is here:

http://aurl.to/v

Later
C

imageimage

July 17
EXTRA! EXTRA! Read all about it! SharePoint Server 2013 is now in public beta!

Well, finally the covers come off and we can start talking about SharePoint 15.  You can download your Beta copy now from here:

 

http://technet.microsoft.com/en-US/evalcenter/hh973397.aspx?wt.mc_id=TEC_121_1_33

 

Enjoy
C

imageimage

1 - 10Next