<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Brian Farnhill</title>
	<atom:link href="http://blog.brianfarnhill.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brianfarnhill.com</link>
	<description>Discussing the ins and outs of developing for SharePoint and the Microsoft platform</description>
	<lastBuildDate>Wed, 01 Sep 2010 02:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.brianfarnhill.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0d959ad8d28ead702fb7642453b49bb8?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Brian Farnhill</title>
		<link>http://blog.brianfarnhill.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.brianfarnhill.com/osd.xml" title="Brian Farnhill" />
	<atom:link rel='hub' href='http://blog.brianfarnhill.com/?pushpress=hub'/>
		<item>
		<title>Project Server PSI Error &#8211; System.Data.SqlTypes.SqlNullValueException: Data is Null.</title>
		<link>http://blog.brianfarnhill.com/2010/09/01/project-server-psi-error-system-data-sqltypes-sqlnullvalueexception-data-is-null/</link>
		<comments>http://blog.brianfarnhill.com/2010/09/01/project-server-psi-error-system-data-sqltypes-sqlnullvalueexception-data-is-null/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 02:59:38 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Project Server]]></category>
		<category><![CDATA[PSI]]></category>
		<category><![CDATA[Exceptions]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/09/01/project-server-psi-error-system-data-sqltypes-sqlnullvalueexception-data-is-null/</guid>
		<description><![CDATA[As anyone who has been following my tweets leading up to Tech.Ed last week will know, I have been doing some work with Project Server 2010, so far as developing some customisations that will work with Project Servers API (called the Project Server Interface, or PSI for short). Now I have some opinions on the <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10557&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As anyone who has been following my tweets leading up to Tech.Ed last week will know, I have been doing some work with Project Server 2010, so far as developing some customisations that will work with Project Servers API (called the Project Server Interface, or PSI for short). Now I have some opinions on the PSI in general (<strong><em>*cough*</em></strong> <em>rubbish</em> <strong><em>*cough*</em></strong>)&#160; but I have been getting the hang of it, and I did come across this error the other day that I thought was worth sharing:</p>
<p><strong>System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values</strong></p>
<p>This was happening when I was trying to add some tasks to an existing project, and was failing at the QueueAddToProject() method. Looking through the stack trace on the error (and seriously don’t get me started on how you get errors out of Project server – I might start coughing again! lol)I found that it was failing while trying to validate the session (with the session being from where I programmatically check out the project before I add to it).</p>
<p>Here was the problem in the end – when you check a project out you need to specify three things – the GUID of the project, a GUID to represent the session ID, and a string the describes the checkout. Initially I was leaving the string empty, because in all honesty I didn’t care that much – but that was the problem for me. As soon as I put a value in that string it was able to happily continue adding my tasks for me.</p>
<p>I would have liked to be given an error when I checked out the project here (rather than letting the code for the checkout execute fine and then whinge when I try to do something with it) but in the end the stack trace made it pretty easy to figure out. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10557/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10557&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/09/01/project-server-psi-error-system-data-sqltypes-sqlnullvalueexception-data-is-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>
	</item>
		<item>
		<title>Inside our SharePoint Saturday attendee packs (aka. Free stuff!)</title>
		<link>http://blog.brianfarnhill.com/2010/07/29/inside-our-sharepoint-saturday-attendee-packs-aka-free-stuff/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/29/inside-our-sharepoint-saturday-attendee-packs-aka-free-stuff/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 09:38:46 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPSaturday]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/07/29/inside-our-sharepoint-saturday-attendee-packs-aka-free-stuff/</guid>
		<description><![CDATA[With SharePoint Saturday Sydney only a week away now I’ve now finally got my hands on to all of the goodies that we are including in our attendee packs for the day – that’s right, every single person who attends SharePoint Saturday Sydney, Canberra or Melbourne will get this pack! A SharePoint Saturday compendium, with <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10555&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With SharePoint Saturday Sydney only a week away now I’ve now finally got my hands on to all of the goodies that we are including in our attendee packs for the day – that’s right, every single person who attends SharePoint Saturday <a href="http://www.sharepointsaturday.org/sydney">Sydney</a>, <a href="http://www.sharepointsaturday.org/canberra">Canberra</a> or <a href="http://www.sharepointsaturday.org/melbourne">Melbourne</a> will get this pack!</p>
<ul>
<li>A SharePoint Saturday compendium, with notepad and calculator</li>
<li>A special SharePoint Saturday pen (metal pen with laser etched SharePoint Saturday logo)</li>
<li>A discount code to attend next year’s <a href="http://www.sharepointconference.com.au/">Australian SharePoint Conference</a> for $600 (ex. GST) – which makes these tickets even cheaper than the early bird prices</li>
<li>A free copy of <a href="http://itunes.apple.com/au/app/ishare/id305862898?mt=8">iShare for iPhone</a> (created by Spyk software) that you can use to access SharePoint sites on the go!</li>
</ul>
<p>If you want to get your hands on all of this great stuff, plus be in the running to win some great raffle prizes, plus get to see some top notch presenters then make sure you get over the websites linked above and register to attend! The Sydney event is currently sold out but we have a waiting list and are working to clear people who can’t attend off the registration list to free up spots, so it’s not too late!</p>
<p>Here are some pics of the compendium and the pen! I hope you all like them!</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/img_3835.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;border-top:0;border-right:0;margin:0 auto 10px;" class="wlDisabledImage" title="IMG_3835" border="0" alt="IMG_3835" src="http://brianfarnhill.files.wordpress.com/2010/07/img_3835_thumb.jpg?w=213&#038;h=240" width="213" height="240" /></a></p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/img_3838.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;border-top:0;border-right:0;margin:0 auto 10px;" class="wlDisabledImage" title="IMG_3838" border="0" alt="IMG_3838" src="http://brianfarnhill.files.wordpress.com/2010/07/img_3838_thumb.jpg?w=240&#038;h=179" width="240" height="179" /></a></p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/img_3839.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;border-top:0;border-right:0;margin:0 auto 10px;" class="wlDisabledImage" title="IMG_3839" border="0" alt="IMG_3839" src="http://brianfarnhill.files.wordpress.com/2010/07/img_3839_thumb.jpg?w=240&#038;h=105" width="240" height="105" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10555/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10555&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/29/inside-our-sharepoint-saturday-attendee-packs-aka-free-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/img_3835_thumb.jpg" medium="image">
			<media:title type="html">IMG_3835</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/img_3838_thumb.jpg" medium="image">
			<media:title type="html">IMG_3838</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/img_3839_thumb.jpg" medium="image">
			<media:title type="html">IMG_3839</media:title>
		</media:content>
	</item>
		<item>
		<title>Using abstract classes in a WCF service</title>
		<link>http://blog.brianfarnhill.com/2010/07/19/using-abstract-classes-in-a-wcf-service/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/19/using-abstract-classes-in-a-wcf-service/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 03:02:08 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Abstract Classes]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/07/19/using-abstract-classes-in-a-wcf-service/</guid>
		<description><![CDATA[So while this isn’t a SharePoint thing, it is something I’ve come across while developing WCF services for a solution that will ultimately tie in with SharePoint, so I figured I would put this out there anyway. Basically here is the scenario – you have a WCF service, and that service has a method that <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10547&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So while this isn’t a SharePoint thing, it is something I’ve come across while developing WCF services for a solution that will ultimately tie in with SharePoint, so I figured I would put this out there anyway. </p>
<p>Basically here is the scenario – you have a WCF service, and that service has a method that takes an abstract class as a parameter – in my case it was an IEnumerable of that abstract class, so like this:</p>
<pre class="brush: csharp;">
[OperationContract]
IEnumerable&lt;MyResult&gt; MySearch(IEnumerable&lt;MyParameter&gt; Parameters);
</pre>
<p>Now basically I have two classes that inherit from that abstract class – MyBasicParameter and MyAdvancedParameter, both with a different set of properties. Now by default when I compile my service and add the service reference to visual studio, it is only going to generate a proxy class for MyParameter, not for the basic or advanced one.</p>
<p>So here is how you get it to work – there is an attribute you can declare for your abstract class called “KnownType” (<a title="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.knowntypeattribute.aspx" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.knowntypeattribute.aspx">http://msdn.microsoft.com/en-us/library/system.runtime.serialization.knowntypeattribute.aspx</a>). This will tell the serialiser that there are other types that it can treat the specified type in the same way as it would the type you are declaring on – simply put, it will tell the serialiser about the child type and let it accept that as valid input where the abstract type is declared. </p>
<p>There are two ways you can use this. The first is to just add [KnownType(typeof(MyBasicParameter))] for each type to the top of you class – this will work and when you generate the proxies for the project consuming your class you will see these types there for use now. I personally wasn’t a fan of this method as it meant I had to remember to add types to this list of attributes as I created them. </p>
<p>The better option is to declare the attribute like this &#8211; [KnownType(&quot;GetKnownTypes&quot;)] – where “GetKnownTypes” is a static method in your class that will return an array of type objects that can be treated as known types. The next step was simply to load a list of all the types that inherited from the MyParameter type and have them return here. Here is the code that will get you there:</p>
<pre class="brush: csharp;">
public static Type[] GetKnownTypes()
{
    return Assembly.GetExecutingAssembly().GetTypes().Where(IsSubClassOfMyParameter).ToArray();
}

private static bool IsSubClassOfMyParameter(Type TypeToCheck)
{
    while (TypeToCheck != typeof(object))
    {
        if (TypeToCheck.BaseType == null) break;

        if (TypeToCheck.BaseType == typeof(MyParameter))
        {
            return true;
        }
        TypeToCheck = TypeToCheck.BaseType;
    }
    return false;
}
</pre>
<p>So now whenever I add a new class, I don’t need to remember to add it as a known type, if it inherits from MyParameter it will automatically be found and a client proxy class will be generated for it in Visual Studio.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10547/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10547/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10547&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/19/using-abstract-classes-in-a-wcf-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating a mail merge in c# with the OpenXML SDK</title>
		<link>http://blog.brianfarnhill.com/2010/07/16/creating-a-mail-merge-in-c-with-the-openxml-sdk/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/16/creating-a-mail-merge-in-c-with-the-openxml-sdk/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 05:02:51 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[OpenXML]]></category>
		<category><![CDATA[Mail Merge]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/07/16/creating-a-mail-merge-in-c-with-the-openxml-sdk/</guid>
		<description><![CDATA[This is something I have come across on site with a client I am working with at the moment. Basically the scenario was this – I am programmatically creating a CSV file, and I am downloading a word document template from a SharePoint site, and I want to set the copy of the word document <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10543&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is something I have come across on site with a client I am working with at the moment. Basically the scenario was this – I am programmatically creating a CSV file, and I am downloading a word document template from a SharePoint site, and I want to set the copy of the word document up with my CSV file so when it opens it is ready to be merged with the data I generated. After hunting around Google for a little while I couldn’t find a good answer that got me what I needed and explained things well enough, so I figured I would put this together to explain it all.</p>
<p>The first thing you need to grab is the OpenXML SDK. I got version 2 from the Microsoft download site at <a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&amp;displaylang=en</a>. When you install it there is a tool called the “OpenXML SDK 2.0 Productivity Tool” that we are going to use to make this process a whole lot easier. Basically what it does is open an OpenXML document (any of the office document formats that end with the ‘x’, like docx, pptx, xlsx, etc) and will show you all of the XML files and structures within the document itself (or the ‘package’ as it is referred to).</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge1.jpg"><img class="wlDisabledImage" style="display:inline;border:0;margin:0 0 10px;" title="mailmerge1" src="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge1_thumb.jpg?w=244&#038;h=227" border="0" alt="mailmerge1" width="244" height="227" align="left" /></a>As a starting point, I manually did the mail merge and saved the word document and then opened it up with this tool to see what I could see. The main part that grabbed my attention was under /word/document.xml –&gt; /word.settings.xml –&gt; w:settings –&gt; w:mailMerge. If you right click on this node and choose “Reflect Code” you will see two windows pop up for you on the right of the window – the first is the actual XML from that node, which is somewhat interesting and confusing at the same time, but the cooler part for me was the C# code it generated below that would create that exact XML node for me – that’s a win right there folks!</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge2.jpg"><img class="wlDisabledImage" style="display:inline;border:0;margin:0 0 10px;" title="mailmerge2" src="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge2_thumb.jpg?w=244&#038;h=87" border="0" alt="mailmerge2" width="244" height="87" align="left" /></a>So before we go any further, I wanted to explain what some of this stuff was before we blindly started working with it – The first few tags (like query, connectionString and dataSource are all used to define the source for the data – brilliant because that’s what we need to set. There are many tags below it though that are called fieldMapData – and it wasn’t clear to me at first what there were – I did figure it out though. If you go back into your word document and have a look under the ‘Mailings’ tab in the ribbon, you will see a button called “Match Fields”. What this does is it lets you map fields in your data source to a set of known fields that word can work with – so when you do things like insert and address block or a greeting line, it will know what field in your datasource maps to things like first name, last name, business address etc. So what you should do before we go any further is go and map all of these fields in your word document, then open it back up in the productivity tool and go back to looking at that code.</p>
<p>Now we can grab all of that C# and put it into our visual studio project – but first we need to give it some context and create the objects that represent the word document itself. Start by opening VS and adding a reference to “DocumentFormat.OpenXml.dll” (its in the directory you installed the SDK in). Now add a reference to DocumentFormat.OpenXml.Packaging and DocumentFormat.OpenXml.Wordprocessing to your class. Now lets add this code to open our document and get ready for the code from the productivity tool.</p>
<pre class="brush: csharp;">
using (WordprocessingDocument wordDocument = WordprocessingDocument.Open(WordDocmentPath, true))
{
    var settingsPart = wordDocument.MainDocumentPart.GetPartsOfType&lt;DocumentSettingsPart&gt;().First();

    if (settingsPart.Settings.OfType&lt;MailMerge&gt;().Count() &gt; 0)
    settingsPart.Settings.OfType&lt;MailMerge&gt;().First().Remove();

    // more code will go here later
}
</pre>
<p>Basically the “WordDocumentPath” variable there is a string representing the location of your word document file. This will open the file and find that settings XML file for us, and then if the MailMerge node already exists it will delete it. Now if you grab the C# inside the GenerateMailMerge() method of the productivity tools output and paste it in where the comment is in the above code, then add this line directly below to add your newly formed section into the document:</p>
<pre class="brush: csharp;">
settingsPart.Settings.InsertAt(mailMerge1, settingsPart.Settings.Count());
</pre>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge3.jpg"><img class="wlDisabledImage" style="display:inline;border:0;margin:0 0 10px;" title="mailmerge3" src="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge3_thumb.jpg?w=244&#038;h=121" border="0" alt="mailmerge3" width="244" height="121" align="left" /></a>So now that all that was done I tested it and when I opened the output word document I get an error about it being corrupted – dang. I had a look through the rest of the document XML files to see if anything else looked important, and there was one thing I did find that will stop this whole thing working if you don’t include it. If you grab a copy of your word document before the mail merge and the one after the mail merge and use the “Compare Files” function, you will see a list of all XML files in the package that have changed – the one that matters here is “/word/_rels/settings.xml.rels”. This defines relationships with other documents that are declared in the settings.xml file we were looking at earlier. If you have a look in the file by double clicking on it, you will see that there is an extra relationship tag that is defined there that points to your CSV file. Now here’s the trick – note the Id property of your relationship tag – now go and have a look back at the XML in the mail merge element, specifically at the &lt;w:dataSource&gt;  element – the Id here is the Id of the relationship tag! This is what is telling the package the location of your CSV file, despite the fact that it looks like the query tag above it does it, and without adding the relationship your merge wont work. Here is a code chunk to create a new relationship in that file:</p>
<pre class="brush: csharp;">
foreach (var relationship in wordDocument.ExternalRelationships.Where(Rel =&gt; Rel.RelationshipType == &quot;http://schemas.openxmlformats.org/officeDocument/2006/relationships/mailMergeSource&quot;))
{
    wordDocument.DeleteExternalRelationship(relationship);
}
var dsRelationship = settingsPart.AddExternalRelationship(&quot;http://schemas.openxmlformats.org/officeDocument/2006/relationships/mailMergeSource&quot;, new Uri(string.Format(&quot;file:///{0}&quot;, CsvPath)));
</pre>
<p>Put that in directly below where the old MailMerge element is removed (so before the rest of the code you copied from the tool). Last but not least if you then look for the line of code you copied from the tool where it creates the DataSourceReference element and replace it with this, it will ensure the correct relationship is referenced as the documents data source.</p>
<pre class="brush: csharp;">
DataSourceReference dataSourceReference1 = new DataSourceReference(){ Id = dsRelationship.Id };
</pre>
<p>So I saved and compiled all that and ran it – and it worked! I then ran it with a few different word document templates and they all worked with the same code too which was awesome. So there you have it kids, hopefully now you understand a bit about how the mail merge stuff works under the hood and you can now know that you can write this stuff up to automate more things for your users if you have to.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10543/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10543&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/16/creating-a-mail-merge-in-c-with-the-openxml-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge1_thumb.jpg" medium="image">
			<media:title type="html">mailmerge1</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge2_thumb.jpg" medium="image">
			<media:title type="html">mailmerge2</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/mailmerge3_thumb.jpg" medium="image">
			<media:title type="html">mailmerge3</media:title>
		</media:content>
	</item>
		<item>
		<title>Another Tech.Ed Session for me this year!</title>
		<link>http://blog.brianfarnhill.com/2010/07/15/another-tech-ed-session-for-me-this-year/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/15/another-tech-ed-session-for-me-this-year/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 13:26:53 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Physical Architecture]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/07/15/another-tech-ed-session-for-me-this-year/</guid>
		<description><![CDATA[Looks like I am going to have my hands full leading up to Tech.Ed Australia this year. I’ve just had it confirmed that I will be presenting a second session at the event! I’ll be presenting the second session with Garth Luke from AvePoint, and we will be discussing best practices with regards to storage <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10535&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="display:inline;margin:0 10px 10px 0;" align="left" src="http://brianfarnhill.files.wordpress.com/2010/07/bb_180_illbethere_local_lg.jpg?w=510" /></p>
<p>Looks like I am going to have my hands full leading up to Tech.Ed Australia this year. I’ve just had it confirmed that I will be presenting a second session at the event! </p>
<p>I’ll be presenting the second session with Garth Luke from AvePoint, and we will be discussing best practices with regards to storage and physical architecture of SharePoint 2010 deployments. Here is the official blurb:</p>
<p>&#160;</p>
<blockquote><p><strong>SharePoint storage and physical architecture best practices </strong>      <br /><em>Brian Farnhill, Garth Luke</em>       <br />SharePoint 2010 makes significant improvements to how key architectural components in a farm and implemented and managed, which means appropriate consideration needs to be made when building your environments to get the most out of the new platform. In this session we will discuss some of these change, including what service applications are and how they work and can scale, as well as ways you can optimise the physical architecture of your farm. This will include discussing what remote blob storage is and how it can be implemented, how you can effectively monitor and report on the performance of your environment, and we will discuss how and why these best practices can be applied. If you are in to getting the most out of your infrastructure then this session is a must.</p>
</blockquote>
<p>I’m really looking forward to presenting with Garth, make sure you come in and say hi to us at the event if you are going to be there!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10535/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10535&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/15/another-tech-ed-session-for-me-this-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/bb_180_illbethere_local_lg.jpg" medium="image" />
	</item>
		<item>
		<title>SharePoint Saturday Sydney Speakers Announced!</title>
		<link>http://blog.brianfarnhill.com/2010/07/14/sharepoint-saturday-sydney-speakers-announced/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/14/sharepoint-saturday-sydney-speakers-announced/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 12:32:16 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPSaturday]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/07/14/sharepoint-saturday-sydney-speakers-announced/</guid>
		<description><![CDATA[SharePoint Saturday Sydney is coming together nicely, and today we have announced our speaker line up for this years event.&#160;&#160; Once again we have had an awesome group of people put their hands up to present for us, which did unfortunately mean that we couldn’t fit everyone in to the schedule, but I’m pretty impressed <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10534&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/sharepointsaturdaysydneysmall.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;margin:0 10px 10px 0;" class="wlDisabledImage" title="SharePointSaturdaySydneySmall" border="0" alt="SharePointSaturdaySydneySmall" align="left" src="http://brianfarnhill.files.wordpress.com/2010/07/sharepointsaturdaysydneysmall_thumb.png?w=240&#038;h=123" width="240" height="123" /></a></p>
<p> SharePoint Saturday Sydney is coming together nicely, and today we have announced our <a href="http://www.sharepointsaturday.org/sydney/Pages/meetings.aspx">speaker line up</a> for this years event.&#160;&#160;
<p>Once again we have had an awesome group of people put their hands up to present for us, which did unfortunately mean that we couldn’t fit everyone in to the schedule, but I’m pretty impressed with the group of people we have together – they are all very passionate about SharePoint and great presenters! </p>
<p>We have also had a huge amount of interest from people wanting to attend the event as well – there has been over 75 registrations made already, and that was before we had announced who was speaking there! Keeping in mind that we have a bit over 80 people attend last years event I think this is a great sign. There are still a few over 40 tickets left, so its not too late to register to attend and be a part of our event. </p>
<p>Also, all attendees will score themselves one of these great looking compendiums! With the SP Saturday logo on the front, and notepad, pen and calculator inside this is a great little thing that you can use to take notes in sessions during the day and then take it home and use it later – and every single person who shows up on the day gets one for free!</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/x2_1f15291.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;margin:0 0 10px;" class="wlDisabledImage" title="x2_1f15291" border="0" alt="x2_1f15291" align="right" src="http://brianfarnhill.files.wordpress.com/2010/07/x2_1f15291_thumb.jpg?w=180&#038;h=239" width="180" height="239" /></a>Once again, I would like to thank all of our sponsors (check out the site for the up to date list) – without their sponsorship events like this simply couldn’t happen – I’m really looking forward to this one, and I hope to see you there!</p>
<p> For more info check out the site at <a href="http://www.sharepointsaturday.org/sydney">http://www.sharepointsaturday.org/sydney</a> or follow us on twitter <a href="http://twitter.com/spssydney">@SPSSydney</a>!  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10534/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10534&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/14/sharepoint-saturday-sydney-speakers-announced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/sharepointsaturdaysydneysmall_thumb.png" medium="image">
			<media:title type="html">SharePointSaturdaySydneySmall</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/x2_1f15291_thumb.jpg" medium="image">
			<media:title type="html">x2_1f15291</media:title>
		</media:content>
	</item>
		<item>
		<title>I&#8217;m presenting at Tech.Ed Australia 2010!</title>
		<link>http://blog.brianfarnhill.com/2010/07/12/im-presenting-at-tech-ed-australia-2010/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/12/im-presenting-at-tech-ed-australia-2010/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 23:07:07 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Office Web Applications]]></category>
		<category><![CDATA[SharePoint Workspace]]></category>

		<guid isPermaLink="false">http://blog.brianfarnhill.com/?p=10518</guid>
		<description><![CDATA[I&#8217;m pretty stoked about this actually, I got the email last week that confirmed that I will be presenting a break out session at Tech.Ed Australia this year! The session I am doing will be a joint session with Joshua Haebets about using Office 2010 anywhere, here is the official blurb:       Office 2010 <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10518&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/bb_180_illbethere_local_lg.jpg"><img class="alignleft size-thumbnail wp-image-10517" title="TechEd-IllBeThere" src="http://brianfarnhill.files.wordpress.com/2010/07/bb_180_illbethere_local_lg.jpg?w=150&#038;h=150" alt="Tech Ed Australia - I'll be there!" width="150" height="150" /></a>I&#8217;m pretty stoked about this actually, I got the email last week that confirmed that I will be presenting a break out session at Tech.Ed Australia this year! The session I am doing will be a joint session with <a href="http://twitter.com/jhaebets">Joshua Haebets</a> about using Office 2010 anywhere, here is the official blurb:</p>
<div style="padding-left:30px;"> </div>
<div style="padding-left:30px;"> </div>
<div style="padding-left:30px;"> </div>
<div style="padding-left:30px;"><strong>Office 2010 Anywhere, Anytime</strong></div>
<div style="padding-left:30px;"><em>Brian Farnhill, Joshua Haebets</em></div>
<div style="padding-left:30px;">Office Web Apps are new to Microsoft Office 2010 and will allow users to work with files from more places and on more devices by providing browser-based viewing and lightweight editing of Microsoft Word, Excel, PowerPoint and OneNote files&#8230; but we also can&#8217;t be online all the time &#8211; SharePoint Workspace allows us to take SharePoint content offline and Office Mobile keeps us up to date when we are away from the Office. Learn how to deploy and configure the Web applications within your organization and what the viewing, sharing, creating, and editing documents experience is like. Understand the use cases for SharePoint Workspace and how to configure it for your environment. Learn about options for viewing Office content on your mobile device.</div>
<p>I&#8217;m really looking forward to giving this presentation, it&#8217;s the first time I&#8217;ve been chosen to present at a Tech.Ed so I&#8217;m very excited to be there. For more information on Tech.Ed you can check out the website at <a href="http://australia.msteched.com/">http://australia.msteched.com/</a>, and if you don&#8217;t like paying full price for tickets, then you should check out your local Microsoft user groups &#8211; there is a user group discount ticket available (and it is the cheapest ticket you can buy at $1550 inc GST, which is the same price you get for booking 30+ people in one order!). We will be taking names to get this order at this month&#8217;s SharePoint user group here in Canberra, so make sure you get along if you want to get a cheap Tech.Ed ticket as well!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10518/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10518&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/12/im-presenting-at-tech-ed-australia-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/bb_180_illbethere_local_lg.jpg?w=150" medium="image">
			<media:title type="html">TechEd-IllBeThere</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing namespaces in WebPart projects for VS2010</title>
		<link>http://blog.brianfarnhill.com/2010/07/02/changing-namespaces-in-webpart-projects-for-vs2010/</link>
		<comments>http://blog.brianfarnhill.com/2010/07/02/changing-namespaces-in-webpart-projects-for-vs2010/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 23:53:57 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://blog.brianfarnhill.com/?p=10513</guid>
		<description><![CDATA[This is a problem I came across today while working on a SharePoint 2010 web part using Visual Studio 2010. Basically the scenario is this, I created a project (using the Silverlight web part project type in this case) and it created the web part feature and classes for me, all using the default namespace <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10513&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a problem I came across today while working on a SharePoint 2010 web part using Visual Studio 2010. Basically the scenario is this, I created a project (using the Silverlight web part project type in this case) and it created the web part feature and classes for me, all using the default namespace the project had when it was created. As you do, I then renamed the namespace to something mroe relvant than just the project name with underscores through it, and when I then deployed my web part I was getting the &#8220;This type is not registered as safe&#8221; error.</p>
<p>So first stop, I went back to the .webpart file that is created &#8211; the assembly name is up to date ebcause it is automatically generated at build time, but the type of the web part still had the old namespace reference, so this was the first place I needed to update it.</p>
<pre class="brush: xml;">
&lt;metaData&gt;
    &lt;type nameMy_Project_Name.SilverlightWebPart.SilverlightWebPart, $SharePoint.Project.AssemblyFullName$&quot; /&gt;
    &lt;importErrorMessage&gt;$Resources:core,ImportErrorMessage;&lt;/importErrorMessage&gt;
&lt;/metaData&gt;
</pre>
<p>Upon cracking open the WSP and having a look at the manifest, I could see that the assembly name was up to date, there as well, but again the type name for the safe control was wrong. To update this (as the manifest is automatically generated) I had a bit of a hunt around Visual Studio and found that if you select the web part feature node in the solution explorer and look in the properties window, there is a &#8220;Safe Control Entires&#8221; property, that you can select and then update the safe control entry that is added to the manifest so that it has the right info.</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/07/safe_controls.jpg"><img class="aligncenter size-thumbnail wp-image-10514" title="safe controls" src="http://brianfarnhill.files.wordpress.com/2010/07/safe_controls.jpg?w=150&#038;h=108" alt="" width="150" height="108" /></a></p>
<p>Once these had been changed I redeployed my web part and everything worked fine!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10513/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10513&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/07/02/changing-namespaces-in-webpart-projects-for-vs2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/07/safe_controls.jpg?w=150" medium="image">
			<media:title type="html">safe controls</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Saturday Canberra and Melbourne announced!</title>
		<link>http://blog.brianfarnhill.com/2010/06/28/sharepoint-saturday-canberra-and-melbourne-announced/</link>
		<comments>http://blog.brianfarnhill.com/2010/06/28/sharepoint-saturday-canberra-and-melbourne-announced/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 08:38:18 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[SPSaturday]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/06/28/sharepoint-saturday-canberra-and-melbourne-announced/</guid>
		<description><![CDATA[Hot on the heels of the announcement of SharePoint Saturday Sydney, we are announcing two more events! The first of which will be in Canberra September 18, followed by Melbourne on October 30. I’m pretty excited to be able to add Canberra to our run this year, and its looking like all three events are <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10512&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="border-width:0;margin:0 0 10px;" src="http://www.sharepointsaturday.org/canberra/SiteImages/SharePointSaturdayCanberra.png" border="0" alt="" /><br />
<img style="border-width:0;margin:0 0 10px;" src="http://www.sharepointsaturday.org/melbourne/SiteImages/SharePointSat314x116_Melbourne.png" border="0" alt="" /></p>
<p>Hot on the heels of the announcement of SharePoint Saturday Sydney, we are announcing two more events! The first of which will be in Canberra September 18, followed by Melbourne on October 30.</p>
<p>I’m pretty excited to be able to add Canberra to our run this year, and its looking like all three events are going to be huge! We are still on the hunt for speakers and sponsors for all three events, so be sure to check out the sites (links below) for information on this.</p>
<p>Also, registrations for all three events are open right now, meaning you can register for them today to lock in your place at what are sure to be some very full events!</p>
<p>More information on the events can be found at <a href="http://SharePointSaturday.org">SharePointSaturday.org</a>:</p>
<ul>
<li><a href="http://sharepointsaturday.org/sydney">Sydney</a></li>
<li><a href="http://sharepointsaturday.org/Canberra">Canberra</a></li>
<li><a href="http://sharepointsaturday.org/Melbourne">Melbourne</a></li>
</ul>
<p>I really hope you can all make it, and be sure to follow the events on twitter as well to keep up with the latest information (@SPSSydney, @SPSCanberra, @SPSMelbourne).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10512&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/06/28/sharepoint-saturday-canberra-and-melbourne-announced/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://www.sharepointsaturday.org/canberra/SiteImages/SharePointSaturdayCanberra.png" medium="image" />

		<media:content url="http://www.sharepointsaturday.org/melbourne/SiteImages/SharePointSat314x116_Melbourne.png" medium="image" />
	</item>
		<item>
		<title>Can&#8217;t set selected email field for BCS contacts lists</title>
		<link>http://blog.brianfarnhill.com/2010/06/23/cant-set-selected-email-field-for-bcs-contacts-lists/</link>
		<comments>http://blog.brianfarnhill.com/2010/06/23/cant-set-selected-email-field-for-bcs-contacts-lists/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 23:20:32 +0000</pubDate>
		<dc:creator>Brian Farnhill</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[BCS]]></category>
		<category><![CDATA[Contacts]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">https://brianfarnhill.wordpress.com/2010/06/23/cant-set-selected-email-field-for-bcs-contacts-lists/</guid>
		<description><![CDATA[This is a bit of weird one I have come across while implementing a contacts list using the BCS with SharePoint 2010. Here is the scenario – we have a SQL database with a massive list of contacts in it, and we want to surface that into Outlook for users through the BCS in SharePoint <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10511&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a bit of weird one I have come across while implementing a contacts list using the BCS with SharePoint 2010. Here is the scenario – we have a SQL database with a massive list of contacts in it, and we want to surface that into Outlook for users through the BCS in SharePoint 2010, so we set up an external list, map the fields to the appropriate ones in Outlook, and the connect it all up. Now at a glance life is good and we have the contacts appearing and the world is safe once more, right? Well not quite, here is my problem with it.</p>
<p>For the purposes of this blog post I set up a basic sample to discuss, so my SQL database has only the following fields: id, firstName, lastName, email1Address, email1AddressType, email1DisplayName. I create an external content type and set up the list the same as you would for any other one, mapping those fields to the office fields of the same names. I hook this up to Outlook and when I look at my contacts, this is what I see:</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/06/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb1.png?w=668&#038;h=233" width="668" height="233" /></a> </p>
<p>Both of these contacts have an email address in the database, so I would expect to see it on the business card view here. If I open the contact up I can see the email address fields are all set correctly – when I go to close the contact though I am prompted to save it, and if I do the email address is then viewable on the business card.</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/06/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb2.png?w=429&#038;h=121" width="429" height="121" /></a> </p>
<p>At this point if I create a new email and type “gary someone” in to the to field I can press ctrl+k to automatically resolve his name, which is what I would expect. If I type “sam someone” though and do the same thing it won’t resolve and will make suggestions for me as to who I mean, and it won’t work until I open her contact and save it like I did with Gary’s. </p>
<p>The reason this is happening, is that there is a field called “Email Selected” that outlook stores for a contact (you can see it if you open the contact, go to the fields view and select “All Contact Fields”). This property seems to tell outlook what the default email address is (so if a contact has more than one, this is the email that will show when the contact is first opened), but if this isn’t set then the contacts name and email address can’t seem to be resolved.</p>
<p><a href="http://brianfarnhill.files.wordpress.com/2010/06/image3.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb3.png?w=592&#038;h=258" width="592" height="258" /></a> </p>
<p>The reason this is a big problem for me is that the “Email Selected” field can’t be mapped through the BCS, and only exists on the client side. So that means that if user A connects to the list, opens every contact to press save and close on them to fix it, when user B connects to the same list later on they will need to do the same thing. This is because the field is not synced back to the server at all.</p>
<p>The bigger problem here is that I don’t have a solution for this (I know I like to put solutions to problems out here on the blog, but at this point I don’t have one!). The ideal solution for me is some way to map that field through the BCS, because then it is within my control to be set to whatever I need it to be. At the moment though plan B is looking like some sort of script at the client side (possibly in another outlook add-in) that fixes the field for users when they open outlook or something like that.</p>
<p>If anyone else has come across this and has a work around I would love to hear it! Leave me a comment below with any info.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brianfarnhill.wordpress.com/10511/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brianfarnhill.wordpress.com/10511/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brianfarnhill.wordpress.com/10511/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.brianfarnhill.com&amp;blog=6527249&amp;post=10511&amp;subd=brianfarnhill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.brianfarnhill.com/2010/06/23/cant-set-selected-email-field-for-bcs-contacts-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb249b6501d7f8b0d997ee8fe92a3ac0?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Brian</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://brianfarnhill.files.wordpress.com/2010/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>