<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>My Fried Tech!</title>
    <link>http://www.myfriedmind.com/techBlog/</link>
    <description>oddities from my work</description>
    <language>en-us</language>
    <copyright>Matt Mcknight</copyright>
    <lastBuildDate>Mon, 05 Dec 2011 18:46:05 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>matt@em.org</managingEditor>
    <webMaster>matt@em.org</webMaster>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=7ee0605e-1327-4aea-a3b8-eded6d059aab</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,7ee0605e-1327-4aea-a3b8-eded6d059aab.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,7ee0605e-1327-4aea-a3b8-eded6d059aab.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=7ee0605e-1327-4aea-a3b8-eded6d059aab</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I apologize for not taking a screen shot of the particular error (0x800...d.. something),
so I could make this entry easier to find. My only excuses are that I am still recovering
from nose surgery and therefore rushed since I have a backlog of projects to whittle
down.
</p>
        <p>
We had an issue with Windows Mobile 7 phones throwing an error when we tried to sync
to Outlook via Activesync. This was caused by the same issue that we encountered here 
- <a href="http://bit.ly/rLMlDl">http://bit.ly/rLMlDl</a>. And the solution is the
same - install the Primary and Secondary certs from Thawte. Only in this case they
need to be installed ONTO the phone.
</p>
        <p>
The simplest way to do this is to download the certs from <a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;actp=CROSSLINK&amp;id=AR1373">https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;actp=CROSSLINK&amp;id=AR1373</a> and
then email them to the phone. Since Outlook obviously is not working, you can use
the Hotmail account the phone should be set up with already.
</p>
        <p>
Once the certs are sent via email (as attachments), you simply click on them in the
email to download them and then, once they are downloaded, click on them again to
install.
</p>
        <p>
Hope that saves some hair on your head...
</p>
        <p>
:)<br /></p>
        <p>
          <br />
        </p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=7ee0605e-1327-4aea-a3b8-eded6d059aab" />
      </body>
      <title>Windows Mobile 7 Certificate error syncing Outlook - uses Thawte</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,7ee0605e-1327-4aea-a3b8-eded6d059aab.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/12/05/WindowsMobile7CertificateErrorSyncingOutlookUsesThawte.aspx</link>
      <pubDate>Mon, 05 Dec 2011 18:46:05 GMT</pubDate>
      <description>&lt;p&gt;
I apologize for not taking a screen shot of the particular error (0x800...d.. something),
so I could make this entry easier to find. My only excuses are that I am still recovering
from nose surgery and therefore rushed since I have a backlog of projects to whittle
down.
&lt;/p&gt;
&lt;p&gt;
We had an issue with Windows Mobile 7 phones throwing an error when we tried to sync
to Outlook via Activesync. This was caused by the same issue that we encountered here&amp;nbsp;
- &lt;a href="http://bit.ly/rLMlDl"&gt;http://bit.ly/rLMlDl&lt;/a&gt;. And the solution is the
same - install the Primary and Secondary certs from Thawte. Only in this case they
need to be installed ONTO the phone.
&lt;/p&gt;
&lt;p&gt;
The simplest way to do this is to download the certs from &lt;a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;actp=CROSSLINK&amp;amp;id=AR1373"&gt;https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;actp=CROSSLINK&amp;amp;id=AR1373&lt;/a&gt; and
then email them to the phone. Since Outlook obviously is not working, you can use
the Hotmail account the phone should be set up with already.
&lt;/p&gt;
&lt;p&gt;
Once the certs are sent via email (as attachments), you simply click on them in the
email to download them and then, once they are downloaded, click on them again to
install.
&lt;/p&gt;
&lt;p&gt;
Hope that saves some hair on your head...
&lt;/p&gt;
&lt;p&gt;
:)&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=7ee0605e-1327-4aea-a3b8-eded6d059aab" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,7ee0605e-1327-4aea-a3b8-eded6d059aab.aspx</comments>
      <category>Exchange 2007</category>
      <category>Windows Mobile 7</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=7e631366-e0b5-44d6-907f-5b63849d950b</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,7e631366-e0b5-44d6-907f-5b63849d950b.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,7e631366-e0b5-44d6-907f-5b63849d950b.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=7e631366-e0b5-44d6-907f-5b63849d950b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Recently we renewed our cert for OWA, using Thawte. When we applied the new one we
started getting various security errors, including such ones as "Windows does not
have enough information to verify this certificate error" and "The security certificate
was issued by a company you have not chosen to trust" (see below)".<br /></p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/certificate-not-trusted.png" border="0" />
        </p>
        <p>
Now this is Thawte, not some fly-by-night place. And our previous cert had worked
just dandy. We were having issues with Outlook, syncing our phones, OWA, etc. So why
were we not trusting them?<br /></p>
        <p>
What I discovered was that in June 2010 Thawte changed their intermediate cert - going
to 2048 - which was a good thing. Unfortunately, because the cert we were replacing
overlapped that time by over a year we were unaware that the new cert needed a new
"Third-Party Root Certificate Authority" cert from Thawte.
</p>
        <p>
Luckily I figured it out, found the appropriate certs on Thawte's site and walked
through their simple step by step instructions to install the cert on the hub server.
Rebooted the server and bingo! All is happy, happy, joy, joy.
</p>
        <p>
Rather than repeat their instructions I will simply give you the links below:
</p>
        <ul>
          <li>
New intermediate certs - <a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;actp=CROSSLINK&amp;id=AR1373">https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;actp=CROSSLINK&amp;id=AR1373</a></li>
          <li>
Instructions for IIS install - <a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;id=SO15007&amp;actp=search&amp;viewlocale=en_US&amp;searchid=1323051600188">https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;id=SO15007&amp;actp=search&amp;viewlocale=en_US&amp;searchid=1323051600188</a></li>
        </ul>
        <p>
Hope this helps...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=7e631366-e0b5-44d6-907f-5b63849d950b" />
      </body>
      <title>Windows does not have enough information to verify this certificate error when launching website - outlook errors, etc, using Thawte Certificate</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,7e631366-e0b5-44d6-907f-5b63849d950b.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/12/05/WindowsDoesNotHaveEnoughInformationToVerifyThisCertificateErrorWhenLaunchingWebsiteOutlookErrorsEtcUsingThawteCertificate.aspx</link>
      <pubDate>Mon, 05 Dec 2011 15:49:36 GMT</pubDate>
      <description>&lt;p&gt;
Recently we renewed our cert for OWA, using Thawte. When we applied the new one we
started getting various security errors, including such ones as "Windows does not
have enough information to verify this certificate error" and "The security certificate
was issued by a company you have not chosen to trust" (see below)".&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/certificate-not-trusted.png" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
Now this is Thawte, not some fly-by-night place. And our previous cert had worked
just dandy. We were having issues with Outlook, syncing our phones, OWA, etc. So why
were we not trusting them?&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
What I discovered was that in June 2010 Thawte changed their intermediate cert - going
to 2048 - which was a good thing. Unfortunately, because the cert we were replacing
overlapped that time by over a year we were unaware that the new cert needed a new
"Third-Party Root Certificate Authority" cert from Thawte.
&lt;/p&gt;
&lt;p&gt;
Luckily I figured it out, found the appropriate certs on Thawte's site and walked
through their simple step by step instructions to install the cert on the hub server.
Rebooted the server and bingo! All is happy, happy, joy, joy.
&lt;/p&gt;
&lt;p&gt;
Rather than repeat their instructions I will simply give you the links below:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
New intermediate certs - &lt;a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;actp=CROSSLINK&amp;amp;id=AR1373"&gt;https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;actp=CROSSLINK&amp;amp;id=AR1373&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Instructions for IIS install - &lt;a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;id=SO15007&amp;amp;actp=search&amp;amp;viewlocale=en_US&amp;amp;searchid=1323051600188"&gt;https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;amp;id=SO15007&amp;amp;actp=search&amp;amp;viewlocale=en_US&amp;amp;searchid=1323051600188&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Hope this helps...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=7e631366-e0b5-44d6-907f-5b63849d950b" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,7e631366-e0b5-44d6-907f-5b63849d950b.aspx</comments>
      <category>Exchange 2007</category>
      <category>IIS</category>
      <category>Internet Explorer</category>
      <category>Office 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=0e0f2296-a295-4d58-8fbe-ff1a6031f5d6</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,0e0f2296-a295-4d58-8fbe-ff1a6031f5d6.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,0e0f2296-a295-4d58-8fbe-ff1a6031f5d6.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=0e0f2296-a295-4d58-8fbe-ff1a6031f5d6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
To give credit where credit is due - this came from http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/e437b1a9-688b-42ba-a32f-866d8d692187/
</p>
        <p>
I had rebuilt my computer and even after installing Sharepoint Designer 2010 it would
prompt me to download and install it whenever I selected "Edit in Sharepoint Designer".
Even re-downloading and reinstalling did not help.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/spdesignerinstallprompt.png" style="margin-left:20px;" border="1" />
        </p>
        <p>
Luckily we have the web, and I located the discussion above. The issue is that I had
disabled the "Sharepoint OpenDocuments Class" add-on.
</p>
        <p>
First, select Manage Add-Ons from the Tools dropdown
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/tools_addons.png" style="margin-left:20px;" border="1" />
        </p>
        <p>
Second Enable the "Sharepoint OpenDocuments Class" add-on
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/enableScreen.png" style="margin-left:20px;" border="1" />
        </p>
        <p>
Voila! Problem fixed...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=0e0f2296-a295-4d58-8fbe-ff1a6031f5d6" />
      </body>
      <title>Sharepoint Designer 2010 prompts even when installed</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,0e0f2296-a295-4d58-8fbe-ff1a6031f5d6.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/11/01/SharepointDesigner2010PromptsEvenWhenInstalled.aspx</link>
      <pubDate>Tue, 01 Nov 2011 17:24:19 GMT</pubDate>
      <description>&lt;p&gt;
To give credit where credit is due - this came from http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/e437b1a9-688b-42ba-a32f-866d8d692187/
&lt;/p&gt;
&lt;p&gt;
I had rebuilt my computer and even after installing Sharepoint Designer 2010 it would
prompt me to download and install it whenever I selected "Edit in Sharepoint Designer".
Even re-downloading and reinstalling did not help.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/spdesignerinstallprompt.png" style="margin-left:20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Luckily we have the web, and I located the discussion above. The issue is that I had
disabled the "Sharepoint OpenDocuments Class" add-on.
&lt;/p&gt;
&lt;p&gt;
First, select Manage Add-Ons from the Tools dropdown
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/tools_addons.png" style="margin-left:20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Second Enable the "Sharepoint OpenDocuments Class" add-on
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/enableScreen.png" style="margin-left:20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Voila! Problem fixed...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=0e0f2296-a295-4d58-8fbe-ff1a6031f5d6" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,0e0f2296-a295-4d58-8fbe-ff1a6031f5d6.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=94821cb1-84d4-491c-8013-67fce27a8ab5</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,94821cb1-84d4-491c-8013-67fce27a8ab5.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,94821cb1-84d4-491c-8013-67fce27a8ab5.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=94821cb1-84d4-491c-8013-67fce27a8ab5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
First off, let me give credit where credit is due - I needed this solution and found
it at <a href="http://decodesharepoint.blogspot.com/2010/02/filter-items-in-view-by-user-or-group.html">http://decodesharepoint.blogspot.com/2010/02/filter-items-in-view-by-user-or-group.html</a>,
a site I will most assuredly go back to. I have added pictures, but the concept comes
from there.<br /></p>
        <p>
The question is how to setup a view that causes a list to filter the items dependent
upon the user viewing it. The pain in this process is that you need to manually specify
for each item who should view it. Nonetheless this can be an enormous time saver.
</p>
        <h2>Here is how to do it:<br /></h2>
        <ol>
          <li>
On the list that you want to filter, create a new Column which is of type "Person
or Group", enable it to allow multiple selections (if you are going to have more than
one person in the list) and select "People Only"<br /><br /><img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredByField.png" border="0" /><br /><br /><br /></li>
          <li>
Create a view<br /><br /><img src="http://www.myfriedmind.com/techBlog/content/binary/StandardView.png" border="0" /><br /><br /><br /></li>
          <li>
In my case I have called the view "FilteredByUsers" (you can always rename it to include
spaces later if you wish) and I have set it as the Default View (which is optional).
What is critically important is that in the "Filtered" section of the View you specify
that FilteredBy column (created in Step #1) "is equal to" [Me]. 
<br /><br /><img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredView.png" border="0" /><br /><br />
[Me] is the short notation for the variable that refers to the person viewing (ah,
hints of old VB...)<br /><br /></li>
          <li>
Add (or modify) an Item to include the person who will be able to view it. In this
case both myself and Odie will be able to view it in the FilteredByUser view....<br /><br /><img src="http://www.myfriedmind.com/techBlog/content/binary/ThirdEntryEdit.png" border="0" /><br /></li>
        </ol>
        <p>
          <br />
        </p>
        <h2>The Result<br /></h2>
        <p>
Now you can switch between two views - the "All Items" which will display items regardless
of who is in the "FilteredBy" column; and the "FillteredByUsersView" that will only
display on those items in which the user has been included in the FilteredBy column.<br /></p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/AllItems[1].png" border="0" />  <img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredByUserView.png" border="0" /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=94821cb1-84d4-491c-8013-67fce27a8ab5" />
      </body>
      <title>Sharepoint 2010 - How to Filter a View by the User Viewing</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,94821cb1-84d4-491c-8013-67fce27a8ab5.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/10/04/Sharepoint2010HowToFilterAViewByTheUserViewing.aspx</link>
      <pubDate>Tue, 04 Oct 2011 21:01:59 GMT</pubDate>
      <description>&lt;p&gt;
First off, let me give credit where credit is due - I needed this solution and found
it at &lt;a href="http://decodesharepoint.blogspot.com/2010/02/filter-items-in-view-by-user-or-group.html"&gt;http://decodesharepoint.blogspot.com/2010/02/filter-items-in-view-by-user-or-group.html&lt;/a&gt;,
a site I will most assuredly go back to. I have added pictures, but the concept comes
from there.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
The question is how to setup a view that causes a list to filter the items dependent
upon the user viewing it. The pain in this process is that you need to manually specify
for each item who should view it. Nonetheless this can be an enormous time saver.
&lt;/p&gt;
&lt;h2&gt;Here is how to do it:&lt;br&gt;
&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
On the list that you want to filter, create a new Column which is of type "Person
or Group", enable it to allow multiple selections (if you are going to have more than
one person in the list) and select "People Only"&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredByField.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Create a view&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/StandardView.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
In my case I have called the view "FilteredByUsers" (you can always rename it to include
spaces later if you wish) and I have set it as the Default View (which is optional).
What is critically important is that in the "Filtered" section of the View you specify
that FilteredBy column (created in Step #1) "is equal to" [Me]. 
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredView.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
[Me] is the short notation for the variable that refers to the person viewing (ah,
hints of old VB...)&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Add (or modify) an Item to include the person who will be able to view it. In this
case both myself and Odie will be able to view it in the FilteredByUser view....&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/ThirdEntryEdit.png" border="0"&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;The Result&lt;br&gt;
&lt;/h2&gt;
&lt;p&gt;
Now you can switch between two views - the "All Items" which will display items regardless
of who is in the "FilteredBy" column; and the "FillteredByUsersView" that will only
display on those items in which the user has been included in the FilteredBy column.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/AllItems[1].png" border="0"&gt;&amp;nbsp; &lt;img src="http://www.myfriedmind.com/techBlog/content/binary/FilteredByUserView.png" border="0"&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=94821cb1-84d4-491c-8013-67fce27a8ab5" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,94821cb1-84d4-491c-8013-67fce27a8ab5.aspx</comments>
      <category>Coding Tricks</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was attempting to change the date on an Sp10 DateTimePicker control by code like
this:
</p>
        <p>
uxMySPDateTimePicker.SelectedDate = new DateTime(2011,10,10);
</p>
        <p>
It did not work. As I stepped through it I noticed that it was 'assigned' but it was
not persisted to the refresh. Luckily for me (and you) I stumbled across this thread
fairly quickly -&gt; <a href="http://www.eggheadcafe.com/microsoft/SharePoint-Windows-Services/31645560/problem-with-sharepoint-datetimecontrol.aspx">http://www.eggheadcafe.com/microsoft/SharePoint-Windows-Services/31645560/problem-with-sharepoint-datetimecontrol.aspx</a></p>
        <p>
Basically you need to run the Clear method before you assign your date, like so -&gt;
</p>
        <p>
uxMySPDateTimePicker.Clear();<br />
uxMySPDateTimePicker.SelectedDate = new DateTime(2011,10,10);
</p>
        <p>
Hope that helps!<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372" />
      </body>
      <title>Cannot Assign Date to Sharepoint 2010 DateTimePicker</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/09/28/CannotAssignDateToSharepoint2010DateTimePicker.aspx</link>
      <pubDate>Wed, 28 Sep 2011 16:34:32 GMT</pubDate>
      <description>&lt;p&gt;
I was attempting to change the date on an Sp10 DateTimePicker control by code like
this:
&lt;/p&gt;
&lt;p&gt;
uxMySPDateTimePicker.SelectedDate = new DateTime(2011,10,10);
&lt;/p&gt;
&lt;p&gt;
It did not work. As I stepped through it I noticed that it was 'assigned' but it was
not persisted to the refresh. Luckily for me (and you) I stumbled across this thread
fairly quickly -&amp;gt; &lt;a href="http://www.eggheadcafe.com/microsoft/SharePoint-Windows-Services/31645560/problem-with-sharepoint-datetimecontrol.aspx"&gt;http://www.eggheadcafe.com/microsoft/SharePoint-Windows-Services/31645560/problem-with-sharepoint-datetimecontrol.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Basically you need to run the Clear method before you assign your date, like so -&amp;gt;
&lt;/p&gt;
&lt;p&gt;
uxMySPDateTimePicker.Clear();&lt;br&gt;
uxMySPDateTimePicker.SelectedDate = new DateTime(2011,10,10);
&lt;/p&gt;
&lt;p&gt;
Hope that helps!&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,9c701bbf-4b7f-4ef8-b3ae-1d9eed05b372.aspx</comments>
      <category>Coding Tricks</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=0d91ea88-d6b3-42a9-ac26-6357b10f17a3</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,0d91ea88-d6b3-42a9-ac26-6357b10f17a3.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,0d91ea88-d6b3-42a9-ac26-6357b10f17a3.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=0d91ea88-d6b3-42a9-ac26-6357b10f17a3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This was a rather odd one. I was using sp10's DateTime Control. It is fairly nifty,
although I would like a DateChanging event so that you could more easily roll it back
if there was a problem.
</p>
        <p>
Still I was using it to trigger an Ajax update of a Gridview. When I ran it initially
the DateChanged event fired, but as I moved forward in coding it suddenly stopped.
</p>
        <p>
After a lot of backtracking and investigation I discovered that it had to do with
the fact that the bit of code that set the Gridview was running BEFORE the DateChanged
method did. By doing this it confused it and prevented it from firing. A quick change
and it works like a charm...
</p>
        <p>
:)<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=0d91ea88-d6b3-42a9-ac26-6357b10f17a3" />
      </body>
      <title>Sharepoint 2010 - Control Event not Firing</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,0d91ea88-d6b3-42a9-ac26-6357b10f17a3.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/09/09/Sharepoint2010ControlEventNotFiring.aspx</link>
      <pubDate>Fri, 09 Sep 2011 14:18:34 GMT</pubDate>
      <description>&lt;p&gt;
This was a rather odd one. I was using sp10's DateTime Control. It is fairly nifty,
although I would like a DateChanging event so that you could more easily roll it back
if there was a problem.
&lt;/p&gt;
&lt;p&gt;
Still I was using it to trigger an Ajax update of a Gridview. When I ran it initially
the DateChanged event fired, but as I moved forward in coding it suddenly stopped.
&lt;/p&gt;
&lt;p&gt;
After a lot of backtracking and investigation I discovered that it had to do with
the fact that the bit of code that set the Gridview was running BEFORE the DateChanged
method did. By doing this it confused it and prevented it from firing. A quick change
and it works like a charm...
&lt;/p&gt;
&lt;p&gt;
:)&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=0d91ea88-d6b3-42a9-ac26-6357b10f17a3" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,0d91ea88-d6b3-42a9-ac26-6357b10f17a3.aspx</comments>
      <category>Coding Tricks</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=bfac56a6-f8ae-47b0-b3f2-789481a7fea9</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,bfac56a6-f8ae-47b0-b3f2-789481a7fea9.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,bfac56a6-f8ae-47b0-b3f2-789481a7fea9.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=bfac56a6-f8ae-47b0-b3f2-789481a7fea9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have mentioned this in another blog - (<a href="http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx">http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx</a>),
but I thought I would pull it out since people appear to be searching specifically
for this question. I cannot take credit for this - this was suggested by Mike Morton
at MSoft after he noticed the way I was suggesting.
</p>
        <p>
There are a number of ways that you can find out the information on a List's Column
(also referred to as a Field). Unlike Sharepoint 2007 you cannot open up the database
and take a look at the XML text stored there because it is no longer stored as XML
text (admit it - you poked around in the database too even though they told you not
to...).
</p>
        <p>
You could access it through Webservices, or put a watch into code, but the most elegant
solution is to take advantage of Visual Studio 2010's Server Explorer (from the View
menu choice). Select the Sharepoint server you want, browse to the List, click on
the Column and voila!
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameServerExplorer.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameProperties.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=bfac56a6-f8ae-47b0-b3f2-789481a7fea9" />
      </body>
      <title>Sharepoint 2010 - How do I find out the Internal Name of my List's Column?</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,bfac56a6-f8ae-47b0-b3f2-789481a7fea9.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/08/18/Sharepoint2010HowDoIFindOutTheInternalNameOfMyListsColumn.aspx</link>
      <pubDate>Thu, 18 Aug 2011 13:50:50 GMT</pubDate>
      <description>&lt;p&gt;
I have mentioned this in another blog - (&lt;a href="http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx"&gt;http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx&lt;/a&gt;),
but I thought I would pull it out since people appear to be searching specifically
for this question. I cannot take credit for this - this was suggested by Mike Morton
at MSoft after he noticed the way I was suggesting.
&lt;/p&gt;
&lt;p&gt;
There are a number of ways that you can find out the information on a List's Column
(also referred to as a Field). Unlike Sharepoint 2007 you cannot open up the database
and take a look at the XML text stored there because it is no longer stored as XML
text (admit it - you poked around in the database too even though they told you not
to...).
&lt;/p&gt;
&lt;p&gt;
You could access it through Webservices, or put a watch into code, but the most elegant
solution is to take advantage of Visual Studio 2010's Server Explorer (from the View
menu choice). Select the Sharepoint server you want, browse to the List, click on
the Column and voila!
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameServerExplorer.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameProperties.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=bfac56a6-f8ae-47b0-b3f2-789481a7fea9" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,bfac56a6-f8ae-47b0-b3f2-789481a7fea9.aspx</comments>
      <category>Coding Tricks</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=9ae191dd-8a3e-43b3-b246-7f1e3206a16b</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,9ae191dd-8a3e-43b3-b246-7f1e3206a16b.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,9ae191dd-8a3e-43b3-b246-7f1e3206a16b.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=9ae191dd-8a3e-43b3-b246-7f1e3206a16b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <style type="text/css">
table
{
   margin-left:20px;
}
table td
{
    font-size:small;
}
</style>
        <p>
There are undoubtedly a number of reasons why this might happen, but here are two
quick ones to check, both can be found in the Elements.xml file<br /></p>
        <ol>
          <li>
Is the ListTemplateId correct?</li>
          <li>
Is the Event registered in the Elements.xml<br /></li>
        </ol>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/Elements.png" style="margin-left: 50px;" border="1" />
        </p>
        <h2>Is the ListTemplateId correct?
</h2>
        <p>
Different List types (such as Contacts vs Announcements vs Custom) have different
ListTemplateIds. If you meant to target a Custom List type (id = 100) but clicked
through too quickly when creating the program you got the Announcements List type
(id = 104). The code will only trigger on the appropriate List type. Luckily the solution
is simply to change the ListTemplateId in the Elements.xml file of your project.
</p>
        <p>
A quick search got me the list from <a href="http://sharepoint-snippets.com/list-template-id-for-sharepoint-lists/">http://sharepoint-snippets.com/list-template-id-for-sharepoint-lists/</a>.
I replicate it below simply because blogs do disappear.
</p>
        <table border="1">
          <tbody>
            <tr>
              <th scope="col">List template name</th>
              <th scope="col">ListTemplateID</th>
            </tr>
            <tr>
              <td>
NoListTemplate</td>
              <td>
0</td>
            </tr>
            <tr>
              <td>
GenericList</td>
              <td>
100</td>
            </tr>
            <tr>
              <td>
DocumentLibrary</td>
              <td>
101</td>
            </tr>
            <tr>
              <td>
Survey</td>
              <td>
102</td>
            </tr>
            <tr>
              <td>
Links</td>
              <td>
103</td>
            </tr>
            <tr>
              <td>
Announcements</td>
              <td>
104</td>
            </tr>
            <tr>
              <td>
Contacts</td>
              <td>
105</td>
            </tr>
            <tr>
              <td>
Events</td>
              <td>
106</td>
            </tr>
            <tr>
              <td>
Tasks</td>
              <td>
107</td>
            </tr>
            <tr>
              <td>
DiscussionBoard</td>
              <td>
108</td>
            </tr>
            <tr>
              <td>
PictureLibrary</td>
              <td>
109</td>
            </tr>
            <tr>
              <td>
DataSources</td>
              <td>
110</td>
            </tr>
            <tr>
              <td>
WebTemplateCatalog</td>
              <td>
111</td>
            </tr>
            <tr>
              <td>
UserInformation</td>
              <td>
112</td>
            </tr>
            <tr>
              <td>
WebPartCatalog</td>
              <td>
113</td>
            </tr>
            <tr>
              <td>
ListTemplateCatalog</td>
              <td>
114</td>
            </tr>
            <tr>
              <td>
XMLForm</td>
              <td>
115</td>
            </tr>
            <tr>
              <td>
MasterPageCatalog</td>
              <td>
116</td>
            </tr>
            <tr>
              <td>
NoCodeWorkflows</td>
              <td>
117</td>
            </tr>
            <tr>
              <td>
WorkflowProcess</td>
              <td>
118</td>
            </tr>
            <tr>
              <td>
WebPageLibrary</td>
              <td>
119</td>
            </tr>
            <tr>
              <td>
CustomGrid</td>
              <td>
120</td>
            </tr>
            <tr>
              <td>
SolutionCatalog</td>
              <td>
121</td>
            </tr>
            <tr>
              <td>
NoCodePublic</td>
              <td>
122</td>
            </tr>
            <tr>
              <td>
ThemeCatalog</td>
              <td>
123</td>
            </tr>
            <tr>
              <td>
DataConnectionLibrary</td>
              <td>
130</td>
            </tr>
            <tr>
              <td>
WorkflowHistory</td>
              <td>
140</td>
            </tr>
            <tr>
              <td>
GanttTasks</td>
              <td>
150</td>
            </tr>
            <tr>
              <td>
Meetings</td>
              <td>
200</td>
            </tr>
            <tr>
              <td>
Agenda</td>
              <td>
201</td>
            </tr>
            <tr>
              <td>
MeetingUser</td>
              <td>
202</td>
            </tr>
            <tr>
              <td>
Decision</td>
              <td>
204</td>
            </tr>
            <tr>
              <td>
MeetingObjective</td>
              <td>
207</td>
            </tr>
            <tr>
              <td>
TextBox</td>
              <td>
210</td>
            </tr>
            <tr>
              <td>
ThingsToBring</td>
              <td>
211</td>
            </tr>
            <tr>
              <td>
HomePageLibrary</td>
              <td>
212</td>
            </tr>
            <tr>
              <td>
Posts</td>
              <td>
301</td>
            </tr>
            <tr>
              <td>
Comments</td>
              <td>
302</td>
            </tr>
            <tr>
              <td>
Categories</td>
              <td>
303</td>
            </tr>
            <tr>
              <td>
Facility</td>
              <td>
402</td>
            </tr>
            <tr>
              <td>
Whereabouts</td>
              <td>
403</td>
            </tr>
            <tr>
              <td>
CallTrack</td>
              <td>
404</td>
            </tr>
            <tr>
              <td>
Circulation</td>
              <td>
405</td>
            </tr>
            <tr>
              <td>
Timecard</td>
              <td>
420</td>
            </tr>
            <tr>
              <td>
Holidays</td>
              <td>
421</td>
            </tr>
            <tr>
              <td>
IMEDic</td>
              <td>
499</td>
            </tr>
            <tr>
              <td>
ExternalList</td>
              <td>
600</td>
            </tr>
            <tr>
              <td>
IssueTracking</td>
              <td>
1100</td>
            </tr>
            <tr>
              <td>
AdminTasks</td>
              <td>
1200</td>
            </tr>
            <tr>
              <td>
HealthRules</td>
              <td>
1220</td>
            </tr>
            <tr>
              <td>
HealthReports</td>
              <td>
1221</td>
            </tr>
            <tr>
              <td>
InvalidType</td>
              <td>
-1</td>
            </tr>
          </tbody>
        </table>
        <br />
        <h2>Is the Event registered in the Elements.xml?
</h2>
        <p>
When you add the event during the creation of the project the Receiver is automatically
added to the Elements.xml. HOWEVER, if you add it later by typing it into the code
page for the project, it will be missing from the Elements.xml. Therefore it is not
registered and will not run.
</p>
        <p>
You can either manually update the Elements.xml, or you can do it the easy way. Click
on the folder that contains the Elements.xml (in this case it is simply EventsReceiver1)
and look at its properties. You can simply select that it Handles whatever your event
is by changing it to True. This will put the entry into the Elements.xml for you.<br /></p>
        <img src="http://www.myfriedmind.com/techBlog/content/binary/AddReceivertoElements.jpg" style="margin-left: 30px;" border="1" />
        <p>
hope this helps...
</p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=9ae191dd-8a3e-43b3-b246-7f1e3206a16b" />
      </body>
      <title>Sharepoint 2010 - List Event Code not being triggered</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,9ae191dd-8a3e-43b3-b246-7f1e3206a16b.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx</link>
      <pubDate>Wed, 17 Aug 2011 16:33:36 GMT</pubDate>
      <description>&lt;style type="text/css"&gt;
table
{
   margin-left:20px;
}
table td
{
    font-size:small;
}
&lt;/style&gt;
&lt;p&gt;
There are undoubtedly a number of reasons why this might happen, but here are two
quick ones to check, both can be found in the Elements.xml file&lt;br&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Is the ListTemplateId correct?&lt;/li&gt;
&lt;li&gt;
Is the Event registered in the Elements.xml&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/Elements.png" style="margin-left: 50px;" border="1"&gt;
&lt;/p&gt;
&lt;h2&gt;Is the ListTemplateId correct?
&lt;/h2&gt;
&lt;p&gt;
Different List types (such as Contacts vs Announcements vs Custom) have different
ListTemplateIds. If you meant to target a Custom List type (id = 100) but clicked
through too quickly when creating the program you got the Announcements List type
(id = 104). The code will only trigger on the appropriate List type. Luckily the solution
is simply to change the ListTemplateId in the Elements.xml file of your project.
&lt;/p&gt;
&lt;p&gt;
A quick search got me the list from &lt;a href="http://sharepoint-snippets.com/list-template-id-for-sharepoint-lists/"&gt;http://sharepoint-snippets.com/list-template-id-for-sharepoint-lists/&lt;/a&gt;.
I replicate it below simply because blogs do disappear.
&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th scope="col"&gt;List template name&lt;/th&gt;
&lt;th scope="col"&gt;ListTemplateID&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
NoListTemplate&lt;/td&gt;
&lt;td&gt;
0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
GenericList&lt;/td&gt;
&lt;td&gt;
100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
DocumentLibrary&lt;/td&gt;
&lt;td&gt;
101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Survey&lt;/td&gt;
&lt;td&gt;
102&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Links&lt;/td&gt;
&lt;td&gt;
103&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Announcements&lt;/td&gt;
&lt;td&gt;
104&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Contacts&lt;/td&gt;
&lt;td&gt;
105&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Events&lt;/td&gt;
&lt;td&gt;
106&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Tasks&lt;/td&gt;
&lt;td&gt;
107&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
DiscussionBoard&lt;/td&gt;
&lt;td&gt;
108&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
PictureLibrary&lt;/td&gt;
&lt;td&gt;
109&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
DataSources&lt;/td&gt;
&lt;td&gt;
110&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
WebTemplateCatalog&lt;/td&gt;
&lt;td&gt;
111&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
UserInformation&lt;/td&gt;
&lt;td&gt;
112&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
WebPartCatalog&lt;/td&gt;
&lt;td&gt;
113&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
ListTemplateCatalog&lt;/td&gt;
&lt;td&gt;
114&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
XMLForm&lt;/td&gt;
&lt;td&gt;
115&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
MasterPageCatalog&lt;/td&gt;
&lt;td&gt;
116&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
NoCodeWorkflows&lt;/td&gt;
&lt;td&gt;
117&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
WorkflowProcess&lt;/td&gt;
&lt;td&gt;
118&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
WebPageLibrary&lt;/td&gt;
&lt;td&gt;
119&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
CustomGrid&lt;/td&gt;
&lt;td&gt;
120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
SolutionCatalog&lt;/td&gt;
&lt;td&gt;
121&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
NoCodePublic&lt;/td&gt;
&lt;td&gt;
122&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
ThemeCatalog&lt;/td&gt;
&lt;td&gt;
123&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
DataConnectionLibrary&lt;/td&gt;
&lt;td&gt;
130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
WorkflowHistory&lt;/td&gt;
&lt;td&gt;
140&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
GanttTasks&lt;/td&gt;
&lt;td&gt;
150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Meetings&lt;/td&gt;
&lt;td&gt;
200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Agenda&lt;/td&gt;
&lt;td&gt;
201&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
MeetingUser&lt;/td&gt;
&lt;td&gt;
202&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Decision&lt;/td&gt;
&lt;td&gt;
204&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
MeetingObjective&lt;/td&gt;
&lt;td&gt;
207&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
TextBox&lt;/td&gt;
&lt;td&gt;
210&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
ThingsToBring&lt;/td&gt;
&lt;td&gt;
211&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
HomePageLibrary&lt;/td&gt;
&lt;td&gt;
212&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Posts&lt;/td&gt;
&lt;td&gt;
301&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Comments&lt;/td&gt;
&lt;td&gt;
302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Categories&lt;/td&gt;
&lt;td&gt;
303&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Facility&lt;/td&gt;
&lt;td&gt;
402&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Whereabouts&lt;/td&gt;
&lt;td&gt;
403&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
CallTrack&lt;/td&gt;
&lt;td&gt;
404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Circulation&lt;/td&gt;
&lt;td&gt;
405&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Timecard&lt;/td&gt;
&lt;td&gt;
420&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Holidays&lt;/td&gt;
&lt;td&gt;
421&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
IMEDic&lt;/td&gt;
&lt;td&gt;
499&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
ExternalList&lt;/td&gt;
&lt;td&gt;
600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
IssueTracking&lt;/td&gt;
&lt;td&gt;
1100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
AdminTasks&lt;/td&gt;
&lt;td&gt;
1200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
HealthRules&lt;/td&gt;
&lt;td&gt;
1220&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
HealthReports&lt;/td&gt;
&lt;td&gt;
1221&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
InvalidType&lt;/td&gt;
&lt;td&gt;
-1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;h2&gt;Is the Event registered in the Elements.xml?
&lt;/h2&gt;
&lt;p&gt;
When you add the event during the creation of the project the Receiver is automatically
added to the Elements.xml. HOWEVER, if you add it later by typing it into the code
page for the project, it will be missing from the Elements.xml. Therefore it is not
registered and will not run.
&lt;/p&gt;
&lt;p&gt;
You can either manually update the Elements.xml, or you can do it the easy way. Click
on the folder that contains the Elements.xml (in this case it is simply EventsReceiver1)
and look at its properties. You can simply select that it Handles whatever your event
is by changing it to True. This will put the entry into the Elements.xml for you.&lt;br&gt;
&lt;/p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/AddReceivertoElements.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;p&gt;
hope this helps...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=9ae191dd-8a3e-43b3-b246-7f1e3206a16b" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,9ae191dd-8a3e-43b3-b246-7f1e3206a16b.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=8d1e39c5-b29e-476e-89da-4be77ba18c5b</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,8d1e39c5-b29e-476e-89da-4be77ba18c5b.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,8d1e39c5-b29e-476e-89da-4be77ba18c5b.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=8d1e39c5-b29e-476e-89da-4be77ba18c5b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h2>The Problem<br /></h2>
        <p>
I came across this issue due to the fact that you cannot use a Choice Column in a
Lookup Field. Basically I wanted to use a Lookup Column in a Calculated field.<br /></p>
        <p>
No dice. 
<br /></p>
        <p>
Look here -&gt; <a href="http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx">http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx</a> for
more info.
</p>
        <h2>Setup for Solution<br /></h2>
        <p>
So what I ended up doing was using some of the nifty new features in Visual Studio
2010 and its integration with Sharepoint 2010, particularly its exposure of List Events.
Leveraging this I was able to create a project that generates a new Column based upon
other Columns. Because it of the way the system functions I can snag the data from
the Lookup Column and use it. In effect I can code my on Calculated Column.
</p>
        <p>
There are a number of good blogs on this, but why not have one more? &lt;g&gt; Plus
I will talk about some extra stuff (like the best way to reference those Columns)...
</p>
        <p>
Let us start with two lists - DataLookup and EventListenerTest.
</p>
        <p>
DataLookup is very simply - it merely consists of the Title Column. Its sole purpose
is to provide a Lookup Column to EventListenerTest. Let's populate it with four entries
with the data "First DataEntry Lookup", "Second DataEntry Lookup", "Third DataEntry
Lookup", and (of course) "Fourth DataEntry Lookup".
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/DataLookupColumns.jpg" style="margin-left: 20px;" border="1" />
        </p>
        <p>
EventListenerTest consists of four Columns besides Title - a Single Line of Text Column
named "SingleLineOfText", a Choice Column named "ChoiceColumn", a DateTime Column
called (you guessed it) DateAndTime with a default of the current date and time, and
a Lookup Column referencing the Title from DataLookup that is named "DataEntryLookup".
Not very creative, but it gets the job done.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/EventListenerTestColumns.jpg" style="margin-left: 20px;" border="1" />
        </p>
        <p>
Our goal is to populate the Title Column with the text generated by combining the
entries contained in the SingleLineofText, the ChoiceColumn and the DataEntryLookup
with spaces in between. Basically [SingleLineOfText] &amp; " " &amp; [ChoiceColumn]
&amp; " " &amp; [DataEntryLookup]. Were we to attempt to do this in a Calculated Column
it would not work because the DataEntryLookup would not be available due to its being
of the Lookup Column type. Please note there are 'workarounds' that involve tricking
Sharepoint 2010 into allowing a Calculated Column to reference a Lookup Column. That
is not what I am aiming towards. Incidentally, I chose the Title column to help show
multiple ways to reference columns.<br /></p>
        <h2>Creating the Project<br /></h2>
        <p>
Creating the Project in Visual Studio 2010 is cake.
</p>
        <ol>
          <li>
Create a new project and from within the Installed Templates. Select Sharepoint; 2010;
then EventReceiver. Give it an appropriate name and click OK.<p><img src="http://www.myfriedmind.com/techBlog/content/binary/CreateProject2.png" border="0" /></p></li>
          <li>
On the next screen you have to decide whether to go sandboxed or farm. 
<br />
This is a bigger issue than at first glance. Normally I would recommend sandboxed
for two reason. First, if you do go to the 'public cloud' you will need to have it
sandboxed unless you are paying for your own box. Second, this should in theory minimize
the amount of times that this program runs. Because EventReceivers are not assigned
to specific lists just to ListTypes, they fire on Every matching ListType Every Time.
It is much nicer to have it fire only on those Lists in the appropriate Site rather
than on every List in your Web.<br /><br /><img src="http://www.myfriedmind.com/techBlog/content/binary/FarmSolution.png" border="0" /><br /><br /></li>
          <li>
Now you get to select the type of event(s) that you want to interact with. In this
case you will want "List Item Events". 
<br />
We are going to select both "An item is being added" (ItemAdding) and "An item is
being updated" (ItemUpdating). For demo purposes I am also going to scroll down and
select "An item was added" (ItemAdded) and "An item was updated" (ItemUpdated).<br />
You also get to choose what type of list that you want these Events to be captured
on. You most likely want to change your event source to be "Custom List". If we selected
"Announcements" (the default) for example, our code would only run when Lists of the
type Announcements Added or Updated to. See <a href="http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx">http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx</a>.<br /></li>
        </ol>
        <h2>Event "properties" - SPItemEventProperties 
</h2>
        <p>
The project now displays with four overridden Methods - ItemAdding; ItemUpdating;
ItemAdded; and ItemUpdated because you are inheriting from SPItemEventReceiver. Just
as in any project, you can simply add more overridden events if you so choose at any
time. HOWEVER, if you do this after the project has been created (and not through
the wizard) then you MUST modify the Elements.XML file or these events will never
be captured. There is a simple way to do this by modifying the properties of the folder
that contains the Elements.xml file. See <a href="http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx">http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx</a> for
more info.<br /></p>
        <h2>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/Override.png" style="margin-left: 20px;" border="1" />
        </h2>
        <p>
It is important to note that they all passed a single object - an SPItemEventProperties
object referred to as "properties". Since we all refactor, we are going then simply
pass that along to a common Method which we will call SetCalculatedTitle. There are
two things to note here which we will utilize later. First, not all the data is populated
equally depending on the SPReceiverEventType (eg ItemAdded vs ItemAdding). Second,
we can determine what the SPReceiverEventType is from the SPItemEventProperties.
</p>
        <p>
To demonstrate what each of these four events exposes we are going to add some code
to this Method. The first thing we have to do is verify that we are in the correct
List. This is achieved by checking the ListTitle property of the SPItemEventProperties
object that we passed in. If it is the correct List, then we will look at particular
aspects to see what each of the events are passed in. 
<br /></p>
        <p>
Important Warning: changing the Title of the List will prevent this code from running.
Unlike Columns, which can be referenced via their internal names (see <a href="http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx">http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx</a> for
more on this), there is no Internal Name property of a List. There is a clunky workaround
I will blog about later, but for now just cross your fingers and hope that your users
do not rename the Title of the List.<br /></p>
        <p>
The SPItemEventProperties object contains a number of properties, including
</p>
        <ul>
          <li>
The name of the List Title</li>
          <li>
The Event Type (or SPEventReceiverType) such as "ItemAdding"<br /></li>
          <li>
The SPListItem itself that is triggering the Event<br /></li>
          <li>
An SPItemEventDataCollection containing the properties of the ListItem before the
event completes (called BeforeProperties)<br /></li>
          <li>
An SPItemEventDataCollection containing the properties of the ListItem after the event
completes (called AfterProperties)<br /></li>
        </ul>
        <h2>What are the properties for each event?
</h2>
        <p>
In order to answer that question I wrote the following bit of code:<br /></p>
        <p>
        private void SetCalculatedTitle(SPItemEventProperties
properties)<br />
        {<br />
            if (properties.ListTitle
== "EventListenerTest")<br />
            {<br />
               
SPListItem _listItem = properties.ListItem;<br /><br />
               
SPItemEventDataCollection _beforeProperties = properties.BeforeProperties;<br />
               
SPItemEventDataCollection _afterProperties = properties.AfterProperties;<br /><br />
               
bool _hasBeforeProperties = HasItems(_beforeProperties);<br />
               
bool _hasAfterProperties = HasItems(_afterProperties);<br /></p>
        <p>
          <br />
               
string _singleLineOfTextFromItem;<br />
               
string _singleLineOfTextFromBeforeProperties;<br />
               
string _singleLineOfTextFromAfterProperties;<br /><br />
               
if (properties.EventType != SPEventReceiverType.ItemAdding)<br />
               
{<br />
                   
_singleLineOfTextFromItem = _listItem["SingleLineOfText"].ToString();<br />
               
}<br />
               
if (_hasBeforeProperties)<br />
               
{<br />
                   
_singleLineOfTextFromBeforeProperties = _beforeProperties["SingleLineOfText"].ToString();<br />
               
}<br />
               
if (_hasAfterProperties)<br />
               
{<br /></p>
        <p>
                   
_singleLineOfTextFromAfterProperties = _afterProperties["SingleLineOfText"].ToString();<br />
               
}<br /><br />
               
int _numberOfBeforePropertiesChanged = properties.BeforeProperties.ChangedProperties.Count;<br />
               
int _numberOfAfterPropertiesChanged = properties.AfterProperties.ChangedProperties.Count;<br />
            }<br />
        }
</p>
        <p>
If you are curious, the HasItems was a simple static method I wrote to return a boolean
as such:
</p>
        <p>
        private static bool HasItems(SPItemEventDataCollection
collection)<br />
        {<br />
            bool _hasItem =
false;<br /><br />
            foreach (object
o in collection)<br />
            {<br />
               
_hasItem = true;<br />
            }<br /><br />
            return _hasItem;<br />
        }<br /></p>
        <p>
Each of the four Methods calls SetCalculatedTitle and passes the properties object,
like so:
</p>
        <p>
       public override void ItemAdding(SPItemEventProperties
properties)<br />
       {<br />
           SetCalculatedTitle(properties);<br />
       }<br />
       public override void ItemUpdating(SPItemEventProperties
properties)<br />
       {<br />
           SetCalculatedTitle(properties);<br />
       }<br />
       public override void ItemAdded(SPItemEventProperties
properties)<br />
       {<br />
           SetCalculatedTitle(properties);<br />
       }<br />
       public override void ItemUpdated(SPItemEventProperties
properties)<br />
       {<br />
           SetCalculatedTitle(properties);<br />
       }<br /></p>
        <p>
So, what are the results? Let us say we create a new item, putting "Hi Mom" in the
SingleLineOfText entry. We then update that item to change the SingleLineOfText to
"Hi Dad".<br /></p>
        <h2>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/AddHiMom.png" style="margin-left: 20px;" border="1" />
        </h2>
        <h2>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/UpdateHiDad.png" style="margin-left: 20px;" border="1" />
        </h2>
        <h3>ItemAdding
</h3>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/ItemAddingProperties.png" style="margin-left: 20px;" border="1" />
        </p>
        <p>
As you can see, the ListItem does not exist (it has not been added), there are no
BeforeProperties, but there are AfterProperties. In fact, this is the only place where
you can find out what is going on.
</p>
        <p>
As you can see, the AfterProperties for the SingleLineOfText column is "Hi Mom". There
is one major showstopper here, which I will also mention later, and that is that Lookup
Columns (which contain a Key called LookupId and a Value called LookupValue) do NOT
have their LookupValue set yet. They do have their LookupId, but it is only when the
ListItem is instantiated that the LookupValue is then assigned. This will play a crucial
role later as we shall see.<br /></p>
        <h3>ItemAdded
</h3>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/ItemAddedProperties.png" style="margin-left: 20px;" border="1" />
        </p>
        <p>
By this time the ListItem exists. This is, of course, because the Item has been Added.
There are still no BeforeProperties, but there are AfterProperties - in fact the same
as in ItemAdding. Both the ListItem properties and the AfterProperties contain the
same column information - they both show that SingleLineOfText is "Hi Mom". Also,
unlike ItemAdding, the LookupValue of a Lookup Column has been set in the ListItem.<br /></p>
        <h3>ItemUpdating
</h3>
        <h2>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/ItemUpdating.png" style="margin-left: 20px;" border="1" />
        </h2>
        <p>
Here is where it gets interesting. The ListItem exists (of course). There are STILL
no BeforeProperties, but there are AfterProperties. However the value of SingleLineOfText
is different in the ListItem (reflecting the original value) and the AfterProperties
(reflecting the new value). ListItem shows "Hi Mom", AfterProperties shows "Hi Dad".
Again, like ItemAdding, the LookupValue of a Lookup Column is not set in the AfterProperties
although its LookupId is. Note that the LookupValue of a Lookup Column exists in the
ListItem, but it is for the original (not updated) value.
</p>
        <h3>ItemUpdated
</h3>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/ItemUpdated.png" style="margin-left: 20px;" border="1" />
        </p>
        <p>
Unlike ItemUpdating, by this time it has already been Updated, and so the AfterProperties
and the ListItem column information for SingleLineOfText both show "Hi Dad". Similar
to ItemAdding the LookupValue of the Lookup Column has been set.<br /></p>
        <h2>So, where do you set the value of Title?
</h2>
        <p>
Is it ItemAdding or ItemAdded? Do you want ItemUpdating or ItemUpdated?
</p>
The answer seems obvious. It is not. <p>
If you were paying attention above you will note that the common thread is AfterProperties.
ItemAdding does not have the ListItem yet, and nobody has a BeforeProperties, but
all have the AfterProperties set to the new values. Except, of course, if you have
a Lookup Column.<br /></p><p>
Since we are going to be using a Lookup Column in our code, we need to create an SPFieldLookupValue
object from the string that is stored in that Column. You then can access the LookupValue
property to get the string you want to use in your code. You would like to do it this
way:
</p><p>
               
SPItemEventDataCollection _afterProperties = properties.AfterProperties;<br />
               
SPFieldLookupValue _dataEntryLookup =<br />
                   
new SPFieldLookupValue(_afterProperties["DataEntryLookup"].ToString()); 
</p><p>
But you can't. 
<br /></p><p>
The issue is that the AfterProperties contains the LookupId, but NOT the LookupValue.
That LookupValue is not assigned until the Item is actually Added or Updated. It is
only then that you can get the LookupValue from an SPFieldLookupValue object. So you
have to do it this way:
</p><p>
               
SPListItem _listItem = properties.ListItem;<br />
               
SPFieldLookupValue _dataEntryLookup =<br />
                   
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());
</p><p>
This will not work in ItemAdding/ItemUpdating. This is because ItemAdding does not
have a ListItem yet, and because the ListItem in ItemUpdating contains the old values.
If the Lookup Column's value has changed then referring to the ListItem will only
give you the old value, not the new.
</p><p>
This means that if you need to use a Lookup Column as part of your code, you can not
use ItemAdding or the ItemUpdating without jumping through some ugly hoops. You can
still use it for validation checking (using LookupID for example), but it gets messy
real fast. Ultimately this means that if you have a Lookup Column that you are needing
the LookupValue for you have to use ItemAdded and ItemUpdated. You could do some validation
in the other two Events like I said, just do not expect it to be smooth.
</p><p>
So, you will need to use ItemAdded/ItemUpdated. As a result, the generating the new
text would look something like this:
</p><p>
               
SPListItem _listItem = properties.ListItem;<br />
               
SPFieldLookupValue _dataEntryLookup =<br />
                   
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());<br />
               
string _newTextForTitle = 
<br />
                   
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],<br />
                   
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);
</p><p>
Assigning it would be equally as simple you would think. What you want to do is assign
it to the AfterProperties.
</p><p>
Remember those? The AfterProperties are what are assigned to the Added/Updated ListItem.
For example, to assign a new Title, you can change it directly like so:
</p><p>
               
SPItemEventDataCollection _afterProperties = properties.AfterProperties;<br />
               
_afterProperties["Title"] = _newTextForTitle;<br /></p><p>
Thus when the Item is Added or Updated it is assigned the new Title. The problem is
that AfterProperties only apply BEFORE the item is Added or Updated. As a result while
you can modify the AfterProperties in ItemAdding and ItemUpdating, You cannot in ItemAdded
and ItemUpdated. Once the ListItem has been Added or Updated, the AfterProperties
cannot be changed.<br /></p><p>
What about directly changing the ListItem itself in ItemAdded and ItemUpdated? Like
so:
</p><p>
               
SPListItem _listItem = properties.ListItem;<br />
               
SPFieldLookupValue _dataEntryLookup =<br />
                   
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());<br />
               
string _newTextForTitle =<br />
                   
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],<br />
                   
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);<br />
               
_listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")] = _newTextForTitle; //
we use the Title Column's GUID for demo<br /></p><p>
We are definitely getting warmer. The only issue is that running this code, while
it does not throw an error, also does not change the value of the Title Column. Why?
Because the Events that we are running this in happen AFTER the ListItem has been
changed. In order to get this change applied we need to call the SystemUpdate event
on the ListItem, like so:
</p><p>
                  
_listItem.SystemUpdate();<br /></p><p>
Except that this throws errors. Why? Because we are triggering the code AGAIN. The
SystemUpdate method of a SPListItem updates the database, which would trigger an Event,
correct? What we need to do is turn off Event notifications for this section of code,
made the change, and turn then back on again
</p><p>
                   
this.EventFiringEnabled = false;<br />
                   
_listItem.SystemUpdateUpdate();<br />
                   
this.EventFiringEnabled = true;
</p><p>
Now our code is using the ItemAdded/ItemUpdated Methods to get the values and update
the Title Column.
</p><h2>Conclusion<br /></h2><p>
In an ideal world there would be one process, one Event to rule them all. In this
case you have options, which is not always a bad thing. The pivotal decision is whether
you are using a Lookup Column in our code. If you are then you should use ItemAdded
and ItemUpdated because the LookupValue of the Lookup Column is not set until after
the changes have been made. If you are not using a Lookup Column, then you are free
to use ItemAdding and ItemUpdating, just remember to use the AfterProperties and not
the ListItem to get the Columns' values.
</p><ul><li>
If using a Lookup Column in your code, using ItemAdded and ItemUpdated. Use the ListItem
to get and set the Columns' values</li><li>
If not using a Lookup Column, you can use ItemAdding and ItemUpdating. Use AfterProperties
to get and set the Columns' values<br /></li></ul><p>
Below is the basic code in which we are using ItemAdded and ItemUpdated:
</p><p>
   public class EventReceiver1 : SPItemEventReceiver<br />
    {<br />
        public override void ItemAdded(SPItemEventProperties
properties)<br />
        {<br />
            SetCalculatedTitle(properties);<br />
        }<br />
        public override void ItemUpdated(SPItemEventProperties
properties)<br />
        {<br />
            SetCalculatedTitle(properties);<br />
        }<br /><br />
        private void SetCalculatedTitle(SPItemEventProperties
properties)<br />
        {<br />
            if (properties.ListTitle
== "EventListenerTest")<br />
            {<br />
               
if (properties.EventType == SPEventReceiverType.ItemAdded || 
<br />
                   
properties.EventType == SPEventReceiverType.ItemUpdated)<br />
               
{<br />
                   
SPListItem _listItem = properties.ListItem;<br /><br />
                   
SPFieldLookupValue _dataEntryLookup =<br />
                       
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());<br /><br />
                   
string _newTextForTitle =<br />
                       
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],<br />
                       
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);<br /><br />
                   
// note that you could also reference the Title column as _listItem["Title"]<br />
                   
_listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")] = _newTextForTitle;<br /><br />
                   
this.EventFiringEnabled = false;<br />
                   
_listItem.SystemUpdate();<br />
                   
this.EventFiringEnabled = true;<br />
               
}<br />
            }<br />
        }<br />
    }
</p><img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8d1e39c5-b29e-476e-89da-4be77ba18c5b" /></body>
      <title>Sharepoint 2010 - How to use List Events to Set a Column's Value using Visual Studio 2010 (C#)</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,8d1e39c5-b29e-476e-89da-4be77ba18c5b.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/08/04/Sharepoint2010HowToUseListEventsToSetAColumnsValueUsingVisualStudio2010C.aspx</link>
      <pubDate>Thu, 04 Aug 2011 15:40:25 GMT</pubDate>
      <description>&lt;h2&gt;The Problem&lt;br&gt;
&lt;/h2&gt;
&lt;p&gt;
I came across this issue due to the fact that you cannot use a Choice Column in a
Lookup Field. Basically I wanted to use a Lookup Column in a Calculated field.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
No dice. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Look here -&amp;gt; &lt;a href="http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx"&gt;http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx&lt;/a&gt; for
more info.
&lt;/p&gt;
&lt;h2&gt;Setup for Solution&lt;br&gt;
&lt;/h2&gt;
&lt;p&gt;
So what I ended up doing was using some of the nifty new features in Visual Studio
2010 and its integration with Sharepoint 2010, particularly its exposure of List Events.
Leveraging this I was able to create a project that generates a new Column based upon
other Columns. Because it of the way the system functions I can snag the data from
the Lookup Column and use it. In effect I can code my on Calculated Column.
&lt;/p&gt;
&lt;p&gt;
There are a number of good blogs on this, but why not have one more? &amp;lt;g&amp;gt; Plus
I will talk about some extra stuff (like the best way to reference those Columns)...
&lt;/p&gt;
&lt;p&gt;
Let us start with two lists - DataLookup and EventListenerTest.
&lt;/p&gt;
&lt;p&gt;
DataLookup is very simply - it merely consists of the Title Column. Its sole purpose
is to provide a Lookup Column to EventListenerTest. Let's populate it with four entries
with the data "First DataEntry Lookup", "Second DataEntry Lookup", "Third DataEntry
Lookup", and (of course) "Fourth DataEntry Lookup".
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/DataLookupColumns.jpg" style="margin-left: 20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
EventListenerTest consists of four Columns besides Title - a Single Line of Text Column
named "SingleLineOfText", a Choice Column named "ChoiceColumn", a DateTime Column
called (you guessed it) DateAndTime with a default of the current date and time, and
a Lookup Column referencing the Title from DataLookup that is named "DataEntryLookup".
Not very creative, but it gets the job done.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/EventListenerTestColumns.jpg" style="margin-left: 20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Our goal is to populate the Title Column with the text generated by combining the
entries contained in the SingleLineofText, the ChoiceColumn and the DataEntryLookup
with spaces in between. Basically [SingleLineOfText] &amp;amp; " " &amp;amp; [ChoiceColumn]
&amp;amp; " " &amp;amp; [DataEntryLookup]. Were we to attempt to do this in a Calculated Column
it would not work because the DataEntryLookup would not be available due to its being
of the Lookup Column type. Please note there are 'workarounds' that involve tricking
Sharepoint 2010 into allowing a Calculated Column to reference a Lookup Column. That
is not what I am aiming towards. Incidentally, I chose the Title column to help show
multiple ways to reference columns.&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;Creating the Project&lt;br&gt;
&lt;/h2&gt;
&lt;p&gt;
Creating the Project in Visual Studio 2010 is cake.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Create a new project and from within the Installed Templates. Select Sharepoint; 2010;
then EventReceiver. Give it an appropriate name and click OK.&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/CreateProject2.png" border="0"&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
On the next screen you have to decide whether to go sandboxed or farm. 
&lt;br&gt;
This is a bigger issue than at first glance. Normally I would recommend sandboxed
for two reason. First, if you do go to the 'public cloud' you will need to have it
sandboxed unless you are paying for your own box. Second, this should in theory minimize
the amount of times that this program runs. Because EventReceivers are not assigned
to specific lists just to ListTypes, they fire on Every matching ListType Every Time.
It is much nicer to have it fire only on those Lists in the appropriate Site rather
than on every List in your Web.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/FarmSolution.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Now you get to select the type of event(s) that you want to interact with. In this
case you will want "List Item Events". 
&lt;br&gt;
We are going to select both "An item is being added" (ItemAdding) and "An item is
being updated" (ItemUpdating). For demo purposes I am also going to scroll down and
select "An item was added" (ItemAdded) and "An item was updated" (ItemUpdated).&lt;br&gt;
You also get to choose what type of list that you want these Events to be captured
on. You most likely want to change your event source to be "Custom List". If we selected
"Announcements" (the default) for example, our code would only run when Lists of the
type Announcements Added or Updated to. See &lt;a href="http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx"&gt;http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx&lt;/a&gt;.&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Event "properties" - SPItemEventProperties 
&lt;/h2&gt;
&lt;p&gt;
The project now displays with four overridden Methods - ItemAdding; ItemUpdating;
ItemAdded; and ItemUpdated because you are inheriting from SPItemEventReceiver. Just
as in any project, you can simply add more overridden events if you so choose at any
time. HOWEVER, if you do this after the project has been created (and not through
the wizard) then you MUST modify the Elements.XML file or these events will never
be captured. There is a simple way to do this by modifying the properties of the folder
that contains the Elements.xml file. See &lt;a href="http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx"&gt;http://www.myfriedmind.com/techBlog/2011/08/17/Sharepoint2010ListEventCodeNotBeingTriggered.aspx&lt;/a&gt; for
more info.&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/Override.png" style="margin-left: 20px;" border="1"&gt;
&lt;/h2&gt;
&lt;p&gt;
It is important to note that they all passed a single object - an SPItemEventProperties
object referred to as "properties". Since we all refactor, we are going then simply
pass that along to a common Method which we will call SetCalculatedTitle. There are
two things to note here which we will utilize later. First, not all the data is populated
equally depending on the SPReceiverEventType (eg ItemAdded vs ItemAdding). Second,
we can determine what the SPReceiverEventType is from the SPItemEventProperties.
&lt;/p&gt;
&lt;p&gt;
To demonstrate what each of these four events exposes we are going to add some code
to this Method. The first thing we have to do is verify that we are in the correct
List. This is achieved by checking the ListTitle property of the SPItemEventProperties
object that we passed in. If it is the correct List, then we will look at particular
aspects to see what each of the events are passed in. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Important Warning: changing the Title of the List will prevent this code from running.
Unlike Columns, which can be referenced via their internal names (see &lt;a href="http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx"&gt;http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx&lt;/a&gt; for
more on this), there is no Internal Name property of a List. There is a clunky workaround
I will blog about later, but for now just cross your fingers and hope that your users
do not rename the Title of the List.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
The SPItemEventProperties object contains a number of properties, including
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
The name of the List Title&lt;/li&gt;
&lt;li&gt;
The Event Type (or SPEventReceiverType) such as "ItemAdding"&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
The SPListItem itself that is triggering the Event&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
An SPItemEventDataCollection containing the properties of the ListItem before the
event completes (called BeforeProperties)&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
An SPItemEventDataCollection containing the properties of the ListItem after the event
completes (called AfterProperties)&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What are the properties for each event?
&lt;/h2&gt;
&lt;p&gt;
In order to answer that question I wrote the following bit of code:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void SetCalculatedTitle(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (properties.ListTitle
== "EventListenerTest")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPListItem _listItem = properties.ListItem;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPItemEventDataCollection _beforeProperties = properties.BeforeProperties;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPItemEventDataCollection _afterProperties = properties.AfterProperties;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
bool _hasBeforeProperties = HasItems(_beforeProperties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
bool _hasAfterProperties = HasItems(_afterProperties);&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _singleLineOfTextFromItem;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _singleLineOfTextFromBeforeProperties;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _singleLineOfTextFromAfterProperties;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if (properties.EventType != SPEventReceiverType.ItemAdding)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_singleLineOfTextFromItem = _listItem["SingleLineOfText"].ToString();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if (_hasBeforeProperties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_singleLineOfTextFromBeforeProperties = _beforeProperties["SingleLineOfText"].ToString();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if (_hasAfterProperties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_singleLineOfTextFromAfterProperties = _afterProperties["SingleLineOfText"].ToString();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
int _numberOfBeforePropertiesChanged = properties.BeforeProperties.ChangedProperties.Count;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
int _numberOfAfterPropertiesChanged = properties.AfterProperties.ChangedProperties.Count;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p&gt;
If you are curious, the HasItems was a simple static method I wrote to return a boolean
as such:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static bool HasItems(SPItemEventDataCollection
collection)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool _hasItem =
false;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (object
o in collection)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_hasItem = true;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _hasItem;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Each of the four Methods calls SetCalculatedTitle and passes the properties object,
like so:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemAdding(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemUpdating(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemAdded(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemUpdated(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
So, what are the results? Let us say we create a new item, putting "Hi Mom" in the
SingleLineOfText entry. We then update that item to change the SingleLineOfText to
"Hi Dad".&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/AddHiMom.png" style="margin-left: 20px;" border="1"&gt;
&lt;/h2&gt;
&lt;h2&gt;&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/UpdateHiDad.png" style="margin-left: 20px;" border="1"&gt;
&lt;/h2&gt;
&lt;h3&gt;ItemAdding
&lt;/h3&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/ItemAddingProperties.png" style="margin-left: 20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
As you can see, the ListItem does not exist (it has not been added), there are no
BeforeProperties, but there are AfterProperties. In fact, this is the only place where
you can find out what is going on.
&lt;/p&gt;
&lt;p&gt;
As you can see, the AfterProperties for the SingleLineOfText column is "Hi Mom". There
is one major showstopper here, which I will also mention later, and that is that Lookup
Columns (which contain a Key called LookupId and a Value called LookupValue) do NOT
have their LookupValue set yet. They do have their LookupId, but it is only when the
ListItem is instantiated that the LookupValue is then assigned. This will play a crucial
role later as we shall see.&lt;br&gt;
&lt;/p&gt;
&lt;h3&gt;ItemAdded
&lt;/h3&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/ItemAddedProperties.png" style="margin-left: 20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
By this time the ListItem exists. This is, of course, because the Item has been Added.
There are still no BeforeProperties, but there are AfterProperties - in fact the same
as in ItemAdding. Both the ListItem properties and the AfterProperties contain the
same column information - they both show that SingleLineOfText is "Hi Mom". Also,
unlike ItemAdding, the LookupValue of a Lookup Column has been set in the ListItem.&lt;br&gt;
&lt;/p&gt;
&lt;h3&gt;ItemUpdating
&lt;/h3&gt;
&lt;h2&gt;&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/ItemUpdating.png" style="margin-left: 20px;" border="1"&gt;
&lt;/h2&gt;
&lt;p&gt;
Here is where it gets interesting. The ListItem exists (of course). There are STILL
no BeforeProperties, but there are AfterProperties. However the value of SingleLineOfText
is different in the ListItem (reflecting the original value) and the AfterProperties
(reflecting the new value). ListItem shows "Hi Mom", AfterProperties shows "Hi Dad".
Again, like ItemAdding, the LookupValue of a Lookup Column is not set in the AfterProperties
although its LookupId is. Note that the LookupValue of a Lookup Column exists in the
ListItem, but it is for the original (not updated) value.
&lt;/p&gt;
&lt;h3&gt;ItemUpdated
&lt;/h3&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/ItemUpdated.png" style="margin-left: 20px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Unlike ItemUpdating, by this time it has already been Updated, and so the AfterProperties
and the ListItem column information for SingleLineOfText both show "Hi Dad". Similar
to ItemAdding the LookupValue of the Lookup Column has been set.&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;So, where do you set the value of Title?
&lt;/h2&gt;
&lt;p&gt;
Is it ItemAdding or ItemAdded? Do you want ItemUpdating or ItemUpdated?
&lt;/p&gt;
The answer seems obvious. It is not.&amp;nbsp;&lt;p&gt;
If you were paying attention above you will note that the common thread is AfterProperties.
ItemAdding does not have the ListItem yet, and nobody has a BeforeProperties, but
all have the AfterProperties set to the new values. Except, of course, if you have
a Lookup Column.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Since we are going to be using a Lookup Column in our code, we need to create an SPFieldLookupValue
object from the string that is stored in that Column. You then can access the LookupValue
property to get the string you want to use in your code. You would like to do it this
way:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPItemEventDataCollection _afterProperties = properties.AfterProperties;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPFieldLookupValue _dataEntryLookup =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new SPFieldLookupValue(_afterProperties["DataEntryLookup"].ToString());&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
But you can't. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
The issue is that the AfterProperties contains the LookupId, but NOT the LookupValue.
That LookupValue is not assigned until the Item is actually Added or Updated. It is
only then that you can get the LookupValue from an SPFieldLookupValue object. So you
have to do it this way:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPListItem _listItem = properties.ListItem;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPFieldLookupValue _dataEntryLookup =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());
&lt;/p&gt;
&lt;p&gt;
This will not work in ItemAdding/ItemUpdating. This is because ItemAdding does not
have a ListItem yet, and because the ListItem in ItemUpdating contains the old values.
If the Lookup Column's value has changed then referring to the ListItem will only
give you the old value, not the new.
&lt;/p&gt;
&lt;p&gt;
This means that if you need to use a Lookup Column as part of your code, you can not
use ItemAdding or the ItemUpdating without jumping through some ugly hoops. You can
still use it for validation checking (using LookupID for example), but it gets messy
real fast. Ultimately this means that if you have a Lookup Column that you are needing
the LookupValue for you have to use ItemAdded and ItemUpdated. You could do some validation
in the other two Events like I said, just do not expect it to be smooth.
&lt;/p&gt;
&lt;p&gt;
So, you will need to use ItemAdded/ItemUpdated. As a result, the generating the new
text would look something like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPListItem _listItem = properties.ListItem;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPFieldLookupValue _dataEntryLookup =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _newTextForTitle = 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);
&lt;/p&gt;
&lt;p&gt;
Assigning it would be equally as simple you would think. What you want to do is assign
it to the AfterProperties.
&lt;/p&gt;
&lt;p&gt;
Remember those? The AfterProperties are what are assigned to the Added/Updated ListItem.
For example, to assign a new Title, you can change it directly like so:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPItemEventDataCollection _afterProperties = properties.AfterProperties;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_afterProperties["Title"] = _newTextForTitle;&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Thus when the Item is Added or Updated it is assigned the new Title. The problem is
that AfterProperties only apply BEFORE the item is Added or Updated. As a result while
you can modify the AfterProperties in ItemAdding and ItemUpdating, You cannot in ItemAdded
and ItemUpdated. Once the ListItem has been Added or Updated, the AfterProperties
cannot be changed.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
What about directly changing the ListItem itself in ItemAdded and ItemUpdated? Like
so:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPListItem _listItem = properties.ListItem;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPFieldLookupValue _dataEntryLookup =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _newTextForTitle =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")] = _newTextForTitle; //
we use the Title Column's GUID for demo&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
We are definitely getting warmer. The only issue is that running this code, while
it does not throw an error, also does not change the value of the Title Column. Why?
Because the Events that we are running this in happen AFTER the ListItem has been
changed. In order to get this change applied we need to call the SystemUpdate event
on the ListItem, like so:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem.SystemUpdate();&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Except that this throws errors. Why? Because we are triggering the code AGAIN. The
SystemUpdate method of a SPListItem updates the database, which would trigger an Event,
correct? What we need to do is turn off Event notifications for this section of code,
made the change, and turn then back on again
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
this.EventFiringEnabled = false;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem.SystemUpdateUpdate();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
this.EventFiringEnabled = true;
&lt;/p&gt;
&lt;p&gt;
Now our code is using the ItemAdded/ItemUpdated Methods to get the values and update
the Title Column.
&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;br&gt;
&lt;/h2&gt;
&lt;p&gt;
In an ideal world there would be one process, one Event to rule them all. In this
case you have options, which is not always a bad thing. The pivotal decision is whether
you are using a Lookup Column in our code. If you are then you should use ItemAdded
and ItemUpdated because the LookupValue of the Lookup Column is not set until after
the changes have been made. If you are not using a Lookup Column, then you are free
to use ItemAdding and ItemUpdating, just remember to use the AfterProperties and not
the ListItem to get the Columns' values.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
If using a Lookup Column in your code, using ItemAdded and ItemUpdated. Use the ListItem
to get and set the Columns' values&lt;/li&gt;
&lt;li&gt;
If not using a Lookup Column, you can use ItemAdding and ItemUpdating. Use AfterProperties
to get and set the Columns' values&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Below is the basic code in which we are using ItemAdded and ItemUpdated:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp; public class EventReceiver1 : SPItemEventReceiver&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemAdded(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void ItemUpdated(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetCalculatedTitle(properties);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void SetCalculatedTitle(SPItemEventProperties
properties)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (properties.ListTitle
== "EventListenerTest")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if (properties.EventType == SPEventReceiverType.ItemAdded || 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
properties.EventType == SPEventReceiverType.ItemUpdated)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPListItem _listItem = properties.ListItem;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SPFieldLookupValue _dataEntryLookup =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new SPFieldLookupValue(_listItem["DataEntryLookup"].ToString());&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
string _newTextForTitle =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
String.Format("{0} {1} {2}", _listItem["SingleLineOfText"],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem["ChoiceColumn"], _dataEntryLookup.LookupValue);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
// note that you could also reference the Title column as _listItem["Title"]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")] = _newTextForTitle;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
this.EventFiringEnabled = false;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_listItem.SystemUpdate();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
this.EventFiringEnabled = true;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8d1e39c5-b29e-476e-89da-4be77ba18c5b" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,8d1e39c5-b29e-476e-89da-4be77ba18c5b.aspx</comments>
      <category>c#</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=1a9b973e-ad20-46f3-84e5-294afe83ed7f</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,1a9b973e-ad20-46f3-84e5-294afe83ed7f.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,1a9b973e-ad20-46f3-84e5-294afe83ed7f.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=1a9b973e-ad20-46f3-84e5-294afe83ed7f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have to give special recognition to Mike Morton at Microsoft for running down for
me the fourth method below. I had chatted with him at Tech Ed specifically if there
was a method other than the initial three and he contacted the SP Platform people
and uncovered the best solution.
</p>
        <p>
Please note that I am leaping both feet into the confusing Sharepoint lingo by calling
what is referred to in the documentation as "Fields" by the commonly used phrase "Column".
In the UI of Sharepoint they are referred to as "Columns", but in the dev environment
of VS 2010 and the documentation they are refered to as "Fields". Please do not get
confused -&gt; Columns == Fields.
</p>
        <hr />
        <p>
One of the fantastic additions to Sharepoint coding in sp10 is the exposure of List
events, including the events for the Adding, Deleting and Updating of SPListItems.
Coupled with the integration with Visual Studio 2010, this has produced a solution
to at least one issue - the inability to use Lookup fields in a Choice Column (see <a href="http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx">http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx</a>).
You can now manually do the work that the  In short you can use code to generate
your a 'Calculated Field' from a selection of columns (and other stuff) and assign
it to a Column of your choosing. Not to mention a whole lot more.<br /></p>
        <p>
Before I post on how to programatically assign a value to a Column based on other
Columns, I wanted to mention one issue that rears its ugly head - what is the best
way to reference the Column(s) that you want to access?
</p>
        <p>
There are three methods show by intellisense, plus a secret one (okay, not secret,
but not explained through intellisense).
</p>
        <p>
Let us say that you decide to create a new column in a list. You create a Column called
"MyColumn", keeping to the best practice of not having spaces in initial Column names.
It is the fourth Column in the list (not in the View, mind you. but the list). You
then rename it to "This Is My Column". When it is created, it is assigned a new Guid
by Sharepoint - in this case we will say fa564e0f-0c70-4ab9-b863-0177e6ddd247. Got
that? 
<br /></p>
        <p>
You now have a Column that has a Sharepoint assigned GUID of fa564e0f-0c70-4ab9-b863-0177e6ddd247;
an Internal Name of "MyColumn"; a Display Name of "This Is My Column"; and it is currently
the fourth Column in the List (not to be confused with a View).<br /></p>
        <p>
As a result there are four ways that you can retrieve this Column from an SPListItem
object in that List. Let us say we have an SPListItem which we have retrieved and
called _listItem (SPListItem _listItem = properties.ListItem). We can then get the
value of the Column we just created:<br /></p>
        <ol>
          <li>
Via the Column's GUID - ex: _listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")]</li>
          <li>
Via the Index of the Column - ex: _listItem[3] // (remember that this is zero-based,
so this is the fourth Column)</li>
          <li>
Via the Display Name of the Column - ex: _listItem["This Is My Column"]</li>
          <li>
Via the Internal Name of the Column - ex: _listItem["MyColumn"]</li>
        </ol>
        <p>
The fourth option - using the Internal (or original) Name of the Column is actually
folded into the third, although intellisense does not display that. As noted at <a href="http://msdn.microsoft.com/en-us/library/ms464204.aspx">http://msdn.microsoft.com/en-us/library/ms464204.aspx</a> -
the runtime will look FIRST for the Internal Name and THEN for the Display Name. More
on that later.
</p>
        <p>
There are obvious issues for each of these means. 
</p>
        <h2>Via the Column's GUID
</h2>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod1.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
The real problem here is, of course, that each time the Column is created on a new
server it is assigned a new GUID. That is, after all, the purpose of GUIDs. This means
that if you are using this method on your dev box, it will be broken once it moves
to a new server. In addition, if a server is lost and recreated (not restored), the
columns will probably be reassigned new GUIDs. A restore should maintain the old GUID
since that is stored in the database. The point is that each creation of the Column
will result in a different GUID.
</p>
        <p>
It is very important to note that this does not apply to the default fields - as noted
at <a href="http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/">http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/</a>.
The Title field, for example, will ALWAYS have a GUID of fa564e0f-0c70-4ab9-b863-0177e6ddd247
no matter how many times it is created.
</p>
        <p>
One possibility is to change the GUIDs when it is published to the production server.
One would need to find the particular Fields GUID that the production server has assigned
it, modify the code, and then publish it up to the production server. Messy, to say
the least.
</p>
        <h2>Via the Index of the Column
</h2>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod2.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
To be brutally honest, this is nice to have but fairly useless for our purposes. Unless
you can guarantee that no one will ever reorder the columns you can let this one go.
It is useful for iterating through the Columns, not for finding a particular Column.
</p>
        <h2>Via the Display Name of the Column
</h2>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod3.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
The Display Name is the name that is, quite simply, the name of the column that is
displayed. It can be changed (unlike Internal Name). Very, very handy. Unfortunately
the only way to guarantee that this works is to guarantee that the users never, ever
change the Display Name. While you can restrict the ability of users to be able to
change column names via permissions, you can never really guarantee that it will not
take place. In addition the ChangeFieldName event is not exposed, so there is no way
to catch this at present. Useful for demo, but not necessarily for development. There
is no real reason to use this when you can choose to go ...
</p>
        <h2>Via the Internal Name of the Column
</h2>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod3.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
The Internal name is the initial name given the Field. If you create a Column and
call it "MyFirstColumn" and then change its Display Name to "Other Data" the Internal
Name is STILL "MyFirstColumn" and the Display Name is now "Other Data". No matter
how many times you change the Display Name, the Internal name will NOT change for
the life of the column.<br /></p>
        <p>
When you pass a string as the Key to find the Column in an SPListItem it looks FIRST
for the Internal Name and THEN for the Display Name. From the article <a href="http://msdn.microsoft.com/en-us/library/ms464204.aspx">http://msdn.microsoft.com/en-us/library/ms464204.aspx</a> -
"The runtime will search first through the internal names of the list item’s fields
for the specified string before searching the display names." So it will find "MyFirstColumn"
before finding "Other Data". 
<br /></p>
        <p>
This is another reason to use this method - it reduces retrieval time.
</p>
        <p>
This means that if you know the Internal Name you can probably code to that with no
issue. Getting the Internal Name from an existing field is fairly simple. Again, thanks
to Mike for the advice. Thanks to the nifty integration with Visual Studio 2010, you
can use Server Explorer to open up the List that you are interested in. Connect the
server via Sharepoint Connections, and then drill down until you find the Column that
you are interested in. Right click and select Properties.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameServerExplorer.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
In the Properties panel you will see the Internal Name, clear as day. In this instance,
although the Display Name is "Favorite Band" we discover that the Internal Name is
"WhoDoYouLike" as shown below.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameProperties.jpg" style="margin-left: 30px;" border="1" />
        </p>
        <h2>So, what is the best way?
</h2>
        <p>
If it is a preexistent Column (such as Title), then you should probably use the GUID.
</p>
        <p>
If it is a new Column, then use the Internal Name. As always, it is generally considered
best practice to name the Columns without spaces and then change its Display Name. 
</p>
        <p>
Now, what happens if someone changes the name of the List? That is a murkier solution
I will talk about later...
</p>
        <p>
Hope this helps...
</p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=1a9b973e-ad20-46f3-84e5-294afe83ed7f" />
      </body>
      <title>Sharepoint 2010 - How best to reference a Column (Field) from an SPListItem</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,1a9b973e-ad20-46f3-84e5-294afe83ed7f.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/07/25/Sharepoint2010HowBestToReferenceAColumnFieldFromAnSPListItem.aspx</link>
      <pubDate>Mon, 25 Jul 2011 18:31:47 GMT</pubDate>
      <description>&lt;p&gt;
I have to give special recognition to Mike Morton at Microsoft for running down for
me the fourth method below. I had chatted with him at Tech Ed specifically if there
was a method other than the initial three and he contacted the SP Platform people
and uncovered the best solution.
&lt;/p&gt;
&lt;p&gt;
Please note that I am leaping both feet into the confusing Sharepoint lingo by calling
what is referred to in the documentation as "Fields" by the commonly used phrase "Column".
In the UI of Sharepoint they are referred to as "Columns", but in the dev environment
of VS 2010 and the documentation they are refered to as "Fields". Please do not get
confused -&amp;gt; Columns == Fields.
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
One of the fantastic additions to Sharepoint coding in sp10 is the exposure of List
events, including the events for the Adding, Deleting and Updating of SPListItems.
Coupled with the integration with Visual Studio 2010, this has produced a solution
to at least one issue - the inability to use Lookup fields in a Choice Column (see &lt;a href="http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx"&gt;http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx&lt;/a&gt;).
You can now manually do the work that the&amp;nbsp; In short you can use code to generate
your a 'Calculated Field' from a selection of columns (and other stuff) and assign
it to a Column of your choosing. Not to mention a whole lot more.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Before I post on how to programatically assign a value to a Column based on other
Columns, I wanted to mention one issue that rears its ugly head - what is the best
way to reference the Column(s) that you want to access?
&lt;/p&gt;
&lt;p&gt;
There are three methods show by intellisense, plus a secret one (okay, not secret,
but not explained through intellisense).
&lt;/p&gt;
&lt;p&gt;
Let us say that you decide to create a new column in a list. You create a Column called
"MyColumn", keeping to the best practice of not having spaces in initial Column names.
It is the fourth Column in the list (not in the View, mind you. but the list). You
then rename it to "This Is My Column". When it is created, it is assigned a new Guid
by Sharepoint - in this case we will say fa564e0f-0c70-4ab9-b863-0177e6ddd247. Got
that? 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
You now have a Column that has a Sharepoint assigned GUID of fa564e0f-0c70-4ab9-b863-0177e6ddd247;
an Internal Name of "MyColumn"; a Display Name of "This Is My Column"; and it is currently
the fourth Column in the List (not to be confused with a View).&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
As a result there are four ways that you can retrieve this Column from an SPListItem
object in that List. Let us say we have an SPListItem which we have retrieved and
called _listItem (SPListItem _listItem = properties.ListItem). We can then get the
value of the Column we just created:&lt;br&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Via the Column's GUID - ex: _listItem[new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247")]&lt;/li&gt;
&lt;li&gt;
Via the Index of the Column - ex: _listItem[3] // (remember that this is zero-based,
so this is the fourth Column)&lt;/li&gt;
&lt;li&gt;
Via the Display Name of the Column - ex: _listItem["This Is My Column"]&lt;/li&gt;
&lt;li&gt;
Via the Internal Name of the Column - ex: _listItem["MyColumn"]&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The fourth option - using the Internal (or original) Name of the Column is actually
folded into the third, although intellisense does not display that. As noted at &lt;a href="http://msdn.microsoft.com/en-us/library/ms464204.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms464204.aspx&lt;/a&gt; -
the runtime will look FIRST for the Internal Name and THEN for the Display Name. More
on that later.
&lt;/p&gt;
&lt;p&gt;
There are obvious issues for each of these means. 
&lt;/p&gt;
&lt;h2&gt;Via the Column's GUID
&lt;/h2&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod1.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
The real problem here is, of course, that each time the Column is created on a new
server it is assigned a new GUID. That is, after all, the purpose of GUIDs. This means
that if you are using this method on your dev box, it will be broken once it moves
to a new server. In addition, if a server is lost and recreated (not restored), the
columns will probably be reassigned new GUIDs. A restore should maintain the old GUID
since that is stored in the database. The point is that each creation of the Column
will result in a different GUID.
&lt;/p&gt;
&lt;p&gt;
It is very important to note that this does not apply to the default fields - as noted
at &lt;a href="http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/"&gt;http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/&lt;/a&gt;.
The Title field, for example, will ALWAYS have a GUID of fa564e0f-0c70-4ab9-b863-0177e6ddd247
no matter how many times it is created.
&lt;/p&gt;
&lt;p&gt;
One possibility is to change the GUIDs when it is published to the production server.
One would need to find the particular Fields GUID that the production server has assigned
it, modify the code, and then publish it up to the production server. Messy, to say
the least.
&lt;/p&gt;
&lt;h2&gt;Via the Index of the Column
&lt;/h2&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod2.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
To be brutally honest, this is nice to have but fairly useless for our purposes. Unless
you can guarantee that no one will ever reorder the columns you can let this one go.
It is useful for iterating through the Columns, not for finding a particular Column.
&lt;/p&gt;
&lt;h2&gt;Via the Display Name of the Column
&lt;/h2&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod3.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
The Display Name is the name that is, quite simply, the name of the column that is
displayed. It can be changed (unlike Internal Name). Very, very handy. Unfortunately
the only way to guarantee that this works is to guarantee that the users never, ever
change the Display Name. While you can restrict the ability of users to be able to
change column names via permissions, you can never really guarantee that it will not
take place. In addition the ChangeFieldName event is not exposed, so there is no way
to catch this at present. Useful for demo, but not necessarily for development. There
is no real reason to use this when you can choose to go ...
&lt;/p&gt;
&lt;h2&gt;Via the Internal Name of the Column
&lt;/h2&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/spListMethod3.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
The Internal name is the initial name given the Field. If you create a Column and
call it "MyFirstColumn" and then change its Display Name to "Other Data" the Internal
Name is STILL "MyFirstColumn" and the Display Name is now "Other Data". No matter
how many times you change the Display Name, the Internal name will NOT change for
the life of the column.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
When you pass a string as the Key to find the Column in an SPListItem it looks FIRST
for the Internal Name and THEN for the Display Name. From the article &lt;a href="http://msdn.microsoft.com/en-us/library/ms464204.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms464204.aspx&lt;/a&gt; -
"The runtime will search first through the internal names of the list item’s fields
for the specified string before searching the display names." So it will find "MyFirstColumn"
before finding "Other Data". 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
This is another reason to use this method - it reduces retrieval time.
&lt;/p&gt;
&lt;p&gt;
This means that if you know the Internal Name you can probably code to that with no
issue. Getting the Internal Name from an existing field is fairly simple. Again, thanks
to Mike for the advice. Thanks to the nifty integration with Visual Studio 2010, you
can use Server Explorer to open up the List that you are interested in. Connect the
server via Sharepoint Connections, and then drill down until you find the Column that
you are interested in. Right click and select Properties.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameServerExplorer.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
In the Properties panel you will see the Internal Name, clear as day. In this instance,
although the Display Name is "Favorite Band" we discover that the Internal Name is
"WhoDoYouLike" as shown below.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/InternalNameProperties.jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;h2&gt;So, what is the best way?
&lt;/h2&gt;
&lt;p&gt;
If it is a preexistent Column (such as Title), then you should probably use the GUID.
&lt;/p&gt;
&lt;p&gt;
If it is a new Column, then use the Internal Name. As always, it is generally considered
best practice to name the Columns without spaces and then change its Display Name. 
&lt;/p&gt;
&lt;p&gt;
Now, what happens if someone changes the name of the List? That is a murkier solution
I will talk about later...
&lt;/p&gt;
&lt;p&gt;
Hope this helps...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=1a9b973e-ad20-46f3-84e5-294afe83ed7f" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,1a9b973e-ad20-46f3-84e5-294afe83ed7f.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=20dce8b4-d76c-4fdf-b771-56cb943a157a</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,20dce8b4-d76c-4fdf-b771-56cb943a157a.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,20dce8b4-d76c-4fdf-b771-56cb943a157a.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=20dce8b4-d76c-4fdf-b771-56cb943a157a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was working on a BCS project via Web Services (more in other posts) when I ran across
a frustrating dead end. When I clicked on the "Edit" for an External List I got a
modal popup informing me that there was an error. It was the standard notification
that advices you to change the customerrors setting in web.config to "RemoteOnly"
or to "Off".
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/sp10webconfigcustomerror[1].jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
Since this was a dev machine I went into the web.config file for the site under is
subfolder (...\inetpub\wwwroot\wss\VirtualDirectories\80) and set the customerrors
line to "Off". I reloaded the site and tried again.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/sp10webconfigcustomerror[1].jpg" style="margin-left: 30px;" border="1" />
        </p>
        <p>
DOH!!!
</p>
        <p>
I dug around, using different tools, trying to finding different means to find out
what was wrong, but ultimately I wanted to know why my customerrors setting was not
sticking. Luckily for me (and you) there are bright people out there and Greg Galipeau
discusses this in his post at <a href="http://www.greggalipeau.com/2010/11/01/sharepoint-2010-customerrors-mode/">http://www.greggalipeau.com/2010/11/01/sharepoint-2010-customerrors-mode/</a></p>
        <p>
The long and the short is that there are TWO web.configs. It appears that the _layouts
subdirectory (this form is located in "../_layouts/listform.aspx") has ITS web.config,
which only actually changes a handful of things. One of them, however, is customerrors...
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/sp10TemplateWebConfig.png" style="margin-left: 30px;" border="1" />
        </p>
        <p>
It is located at \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
(ie within the "14-hive"). Changing the setting in that web.config to &lt;customErrors
mode="Off" /&gt; caused the issue to successfully appear in the Modal popup, in this
case an issue with the Edit Form:<br /></p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/sp10modalerrordisplayed[1].png" style="margin-left: 30px;" border="1" />
        </p>
        <p>
You should especially pay attention to the fact that modifying the website's web.config
(vs the Layouts folder) will have no effect upon the popups. The web.config settings
in the LAYOUTS folder will OVERRIDE the settings in your website. If the Layouts has
customerrors mode="off" and your website has customerrors mode="on", the _layouts
will still display the error.
</p>
        <p>
You could remove that line from the web.config in the Layouts folder, and then it
would inherit the settings from your site, but don't tell anyone I suggested it...
</p>
        <p>
Hope that helps...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=20dce8b4-d76c-4fdf-b771-56cb943a157a" />
      </body>
      <title>Sharepoint 2010 Modal Popup still not displaying error information even though web.config has customerrors="off"</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,20dce8b4-d76c-4fdf-b771-56cb943a157a.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/06/07/Sharepoint2010ModalPopupStillNotDisplayingErrorInformationEvenThoughWebconfigHasCustomerrorsoff.aspx</link>
      <pubDate>Tue, 07 Jun 2011 15:39:04 GMT</pubDate>
      <description>&lt;p&gt;
I was working on a BCS project via Web Services (more in other posts) when I ran across
a frustrating dead end. When I clicked on the "Edit" for an External List I got a
modal popup informing me that there was an error. It was the standard notification
that advices you to change the customerrors setting in web.config to "RemoteOnly"
or to "Off".
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/sp10webconfigcustomerror[1].jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
Since this was a dev machine I went into the web.config file for the site under is
subfolder (...\inetpub\wwwroot\wss\VirtualDirectories\80) and set the customerrors
line to "Off". I reloaded the site and tried again.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/sp10webconfigcustomerror[1].jpg" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
DOH!!!
&lt;/p&gt;
&lt;p&gt;
I dug around, using different tools, trying to finding different means to find out
what was wrong, but ultimately I wanted to know why my customerrors setting was not
sticking. Luckily for me (and you) there are bright people out there and Greg Galipeau
discusses this in his post at &lt;a href="http://www.greggalipeau.com/2010/11/01/sharepoint-2010-customerrors-mode/"&gt;http://www.greggalipeau.com/2010/11/01/sharepoint-2010-customerrors-mode/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The long and the short is that there are TWO web.configs. It appears that the _layouts
subdirectory (this form is located in "../_layouts/listform.aspx") has ITS web.config,
which only actually changes a handful of things. One of them, however, is customerrors...
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/sp10TemplateWebConfig.png" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
It is located at \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
(ie within the "14-hive"). Changing the setting in that web.config to &amp;lt;customErrors
mode="Off" /&amp;gt; caused the issue to successfully appear in the Modal popup, in this
case an issue with the Edit Form:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/sp10modalerrordisplayed[1].png" style="margin-left: 30px;" border="1"&gt;
&lt;/p&gt;
&lt;p&gt;
You should especially pay attention to the fact that modifying the website's web.config
(vs the Layouts folder) will have no effect upon the popups. The web.config settings
in the LAYOUTS folder will OVERRIDE the settings in your website. If the Layouts has
customerrors mode="off" and your website has customerrors mode="on", the _layouts
will still display the error.
&lt;/p&gt;
&lt;p&gt;
You could remove that line from the web.config in the Layouts folder, and then it
would inherit the settings from your site, but don't tell anyone I suggested it...
&lt;/p&gt;
&lt;p&gt;
Hope that helps...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=20dce8b4-d76c-4fdf-b771-56cb943a157a" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,20dce8b4-d76c-4fdf-b771-56cb943a157a.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=a18327be-fa28-4793-ba2b-c7f7db7a9e97</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,a18327be-fa28-4793-ba2b-c7f7db7a9e97.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,a18327be-fa28-4793-ba2b-c7f7db7a9e97.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=a18327be-fa28-4793-ba2b-c7f7db7a9e97</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the many nice things about the current iterations of SQL since s05 is the inclusion
of Common Table Expressions (CTE). A CTE is a 'derived table', which means that it
can replace the temporary tables that we have used on occasion as well as functioning
as a temporary View. Because these are restricted to the query you do not have to
worry about their existence once the query is gone.
</p>
        <p>
One of my favorite tricks with a CTE is to use it for a list of weeks, which I can
then join with tables that have dates to sort them. This allows me to do an outer
join and include weeks that have no data in the physical table itself. I wish I could
point you to the discussion that stirred this idea, but I cannot find it anymore...<br /></p>
        <p>
Example:
</p>
        <p>
DECLARE @startDate DateTime = '9/1/10'<br />
DECLARE @endDate DateTime = '8/31/11'<br />
    
<br />
DECLARE @startOfWeek DateTime = DATEADD(day, -(Datepart(dw, @startDate) - 1), @startDate)<br /><br />
With Weeks (StartOfWeek, EndOfWeek, weekNumber, yearFor) AS 
<br />
( select<br />
    @startOfWeek as StartOfWeek,<br />
    DATEADD(DAY, 6, @startOfWeek) as EndOfWeek,<br />
    DATEPART(WEEK, @startOfWeek),<br />
    DATEPART(YEAR, @startOfWeek)<br />
  UNION ALL<br />
  select<br />
    DATEADD(DAY, 7, StartOfWeek),<br />
    DATEADD(DAY, 7, EndOfWeek),<br />
    DATEPART(WEEK, DATEADD(day, 7, StartOfWeek)),<br />
    DATEPART(YEAR, DATEADD(day, 7, StartOfWeek))<br />
  from<br />
    Weeks<br />
  where<br />
    EndOfWeek &lt;= @endDate<br />
),<br />
BillingSummary(weekNumber, yearFor, ClientId, TotalHours) AS<br />
( Select<br />
    DATEPART(WEEK, DateFor) As weekNumber,<br />
    DATEPART(YEAR, DateFor) As YearFor,<br />
    ClientId,<br />
    SUM(HoursBilled) AS TotalHours<br />
  From Billing<br />
  Where DateFor &gt;= @startDate And DateFor &lt;= @endDate<br />
      Group By ClientId, DATEPART(YEAR, DateFor),DATEPART(WEEK,
DateFor)<br />
 )<br />
  Select W.StartOfWeek, W.EndOfWeek, 
<br />
    IsNull(S.ClientId,'') AS ClientId, IsNull(S.TotalHours,0) As TotalHours<br />
   From Weeks W<br />
    Left Outer Join BillingSummary S ON W.yearFor = S.yearFor AND W.weekNumber
= S.weekNumber<br />
    Order By W.startOfWeek Desc<br /></p>
        <p>
Hope this helps...
</p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=a18327be-fa28-4793-ba2b-c7f7db7a9e97" />
      </body>
      <title>Common Table Expression to produce a list of weeks in Sql</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,a18327be-fa28-4793-ba2b-c7f7db7a9e97.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/05/12/CommonTableExpressionToProduceAListOfWeeksInSql.aspx</link>
      <pubDate>Thu, 12 May 2011 18:16:04 GMT</pubDate>
      <description>&lt;p&gt;
One of the many nice things about the current iterations of SQL since s05 is the inclusion
of Common Table Expressions (CTE). A CTE is a 'derived table', which means that it
can replace the temporary tables that we have used on occasion as well as functioning
as a temporary View. Because these are restricted to the query you do not have to
worry about their existence once the query is gone.
&lt;/p&gt;
&lt;p&gt;
One of my favorite tricks with a CTE is to use it for a list of weeks, which I can
then join with tables that have dates to sort them. This allows me to do an outer
join and include weeks that have no data in the physical table itself. I wish I could
point you to the discussion that stirred this idea, but I cannot find it anymore...&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Example:
&lt;/p&gt;
&lt;p&gt;
DECLARE @startDate DateTime = '9/1/10'&lt;br&gt;
DECLARE @endDate DateTime = '8/31/11'&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
DECLARE @startOfWeek DateTime = DATEADD(day, -(Datepart(dw, @startDate) - 1), @startDate)&lt;br&gt;
&lt;br&gt;
With Weeks (StartOfWeek, EndOfWeek, weekNumber, yearFor) AS 
&lt;br&gt;
( select&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @startOfWeek as StartOfWeek,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEADD(DAY, 6, @startOfWeek) as EndOfWeek,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(WEEK, @startOfWeek),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(YEAR, @startOfWeek)&lt;br&gt;
&amp;nbsp; UNION ALL&lt;br&gt;
&amp;nbsp; select&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEADD(DAY, 7, StartOfWeek),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEADD(DAY, 7, EndOfWeek),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(WEEK, DATEADD(day, 7, StartOfWeek)),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(YEAR, DATEADD(day, 7, StartOfWeek))&lt;br&gt;
&amp;nbsp; from&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Weeks&lt;br&gt;
&amp;nbsp; where&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; EndOfWeek &amp;lt;= @endDate&lt;br&gt;
),&lt;br&gt;
BillingSummary(weekNumber, yearFor, ClientId, TotalHours) AS&lt;br&gt;
( Select&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(WEEK, DateFor) As weekNumber,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEPART(YEAR, DateFor) As YearFor,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ClientId,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(HoursBilled) AS TotalHours&lt;br&gt;
&amp;nbsp; From Billing&lt;br&gt;
&amp;nbsp; Where DateFor &amp;gt;= @startDate And DateFor &amp;lt;= @endDate&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Group By ClientId, DATEPART(YEAR, DateFor),DATEPART(WEEK,
DateFor)&lt;br&gt;
&amp;nbsp;)&lt;br&gt;
&amp;nbsp; Select W.StartOfWeek, W.EndOfWeek, 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IsNull(S.ClientId,'') AS ClientId, IsNull(S.TotalHours,0) As TotalHours&lt;br&gt;
&amp;nbsp;&amp;nbsp; From Weeks W&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Left Outer Join BillingSummary S ON W.yearFor = S.yearFor AND W.weekNumber
= S.weekNumber&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Order By W.startOfWeek Desc&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Hope this helps...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=a18327be-fa28-4793-ba2b-c7f7db7a9e97" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,a18327be-fa28-4793-ba2b-c7f7db7a9e97.aspx</comments>
      <category>Sql 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=37927a3a-6a6c-4cc2-b4cb-2a140614dacc</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,37927a3a-6a6c-4cc2-b4cb-2a140614dacc.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,37927a3a-6a6c-4cc2-b4cb-2a140614dacc.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=37927a3a-6a6c-4cc2-b4cb-2a140614dacc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
LOL! In hunting down something else I stumbled across this blog entry -&gt; <a href="http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/">http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/</a> which
has all the standard columns (including Title) with their GUIDs! 
<br /></p>
        <p>
AWESOME!!!
</p>
        <p>
Just an fyi...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=37927a3a-6a6c-4cc2-b4cb-2a140614dacc" />
      </body>
      <title>Sharepoint 2010 Title Column GUID</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,37927a3a-6a6c-4cc2-b4cb-2a140614dacc.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/04/07/Sharepoint2010TitleColumnGUID.aspx</link>
      <pubDate>Thu, 07 Apr 2011 19:19:07 GMT</pubDate>
      <description>&lt;p&gt;
LOL! In hunting down something else I stumbled across this blog entry -&amp;gt; &lt;a href="http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/"&gt;http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/&lt;/a&gt; which
has all the standard columns (including Title) with their GUIDs! 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
AWESOME!!!
&lt;/p&gt;
&lt;p&gt;
Just an fyi...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=37927a3a-6a6c-4cc2-b4cb-2a140614dacc" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,37927a3a-6a6c-4cc2-b4cb-2a140614dacc.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=649c1a52-b86d-42e7-a449-c28f2bbbbecc</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,649c1a52-b86d-42e7-a449-c28f2bbbbecc.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,649c1a52-b86d-42e7-a449-c28f2bbbbecc.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=649c1a52-b86d-42e7-a449-c28f2bbbbecc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Working on creating a web template system to create a designed site and ran into the
above error. Found this note -&gt; <a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/27ac36ca-3d3a-47eb-9fc6-ee1b1846b8a3/">http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/27ac36ca-3d3a-47eb-9fc6-ee1b1846b8a3/</a><br /></p>
        <p>
Basically you need to change the entry in the 'File' section from 'GhostableInLibrary'
to 'Ghostable' 
<br /></p>
        <p>
&lt;File Url="Default.aspx" Type="Ghostable /&gt;<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=649c1a52-b86d-42e7-a449-c28f2bbbbecc" />
      </body>
      <title>Failed to instantiate file ... from module ...: The specified list does not exist. - Sharepoint 2010</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,649c1a52-b86d-42e7-a449-c28f2bbbbecc.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/04/05/FailedToInstantiateFileFromModuleTheSpecifiedListDoesNotExistSharepoint2010.aspx</link>
      <pubDate>Tue, 05 Apr 2011 14:21:31 GMT</pubDate>
      <description>&lt;p&gt;
Working on creating a web template system to create a designed site and ran into the
above error. Found this note -&amp;gt; &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/27ac36ca-3d3a-47eb-9fc6-ee1b1846b8a3/"&gt;http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/27ac36ca-3d3a-47eb-9fc6-ee1b1846b8a3/&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Basically you need to change the entry in the 'File' section from 'GhostableInLibrary'
to 'Ghostable' 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;lt;File Url="Default.aspx" Type="Ghostable /&amp;gt;&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=649c1a52-b86d-42e7-a449-c28f2bbbbecc" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,649c1a52-b86d-42e7-a449-c28f2bbbbecc.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=8302c92b-7595-4d8c-8213-692adb5a47de</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,8302c92b-7595-4d8c-8213-692adb5a47de.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,8302c92b-7595-4d8c-8213-692adb5a47de.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=8302c92b-7595-4d8c-8213-692adb5a47de</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font color="#ff0000">
            <b>Due to the number of updates on this issue, I have included
them at the top... below is them is the original blog...<br /></b>
          </font>
        </p>
        <p>
          <font color="#ff0000">
            <b>
              <br />
            </b>
          </font>
        </p>
        <p>
          <font color="#ff0000">
            <b>Update</b>
          </font>: MSoft has written a vbs script to do the
same as what I have listed below. The main difference is that you do not need to hunt
through pending.xml - look at ht<a href="http://support.microsoft.com/kb/975484">tp://support.microsoft.com/kb/975484</a> for
more info.
</p>
        <p>
Update: MSoft has redone how WSUS rolls out w07sp1 - "Packages have been updated to
address a known issue." <a href="http://support.microsoft.com/kb/894199">http://support.microsoft.com/kb/894199</a> which
might help this issue. Note that this does not appear to be a change in sp1, but in
the wsus rollout format...
</p>
        <p>
Update: MSoft has released Remote Adminsitration Tools that work with SP1 -&gt; <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d</a><br /></p>
        <p>
Further Notes on issues with w07 sp1 in general: <a href="http://www.infoworld.com/t/microsoft-windows/what-you-need-know-about-windows-7-service-pack-1-699">http://www.infoworld.com/t/microsoft-windows/what-you-need-know-about-windows-7-service-pack-1-699</a><br /></p>
        <p>
Fur<br /></p>
        <p>
Recently rolled out SP1 to our wee test group on WSUS. While it worked for most, one
machine simply refused to boot, giving the BSOD (black screen of death) with "Fatal
Error C0000034" as witnessed below...
</p>
        <blockquote>
          <blockquote>
            <p>
              <img src="http://www.myfriedmind.com/techBlog/content/binary/FatalErrorC0000034.jpg" border="0" />
            </p>
          </blockquote>
        </blockquote>
        <p>
Before I lay out what worked for us, let me give credit where credit is due - specifically
to "thewoot" -&gt; <a href="http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/1c9a7151-b48c-4a98-aae7-a4b82682ea8e/#bcabda57-7338-499f-aee2-d708e76df315">you
can see his post here</a>. He also mentions that you can send him money via paypal
if you want to say thank you in a practical way - considering the potential costs
to your organization I don't think that is a bad idea at all...
</p>
        <p>
Here are his steps (with some notes of changes...)
</p>
        <p>
1 - Reboot your computer with the Windows 7 disc in the drive
</p>
        <p>
2 - Select "Launch Startup Repair"
</p>
        <blockquote>
          <blockquote>
            <p>
              <img src="http://www.myfriedmind.com/techBlog/content/binary/Recov-1.jpg" border="0" />
            </p>
          </blockquote>
        </blockquote>
        <p>
3 - <font color="#ff0000">!!!</font> Cancel the "repair"
</p>
        <p>
4 - Click on "Don't Send" (if they don't know by now...)
</p>
        <blockquote>
          <blockquote>
            <p>
              <img src="http://www.myfriedmind.com/techBlog/content/binary/cancelNotification.jpg" border="0" />
            </p>
          </blockquote>
        </blockquote>
        <p>
5 - <font color="#ff0000">!!!!</font> Click on the link "View advanced options for
recovery and support"
</p>
        <blockquote>
          <blockquote>
            <p>
              <img src="http://www.myfriedmind.com/techBlog/content/binary/AdvancedOptions[1].jpg" border="0" />
            </p>
          </blockquote>
        </blockquote>
        <p>
6 - Click on the "Command Prompt" link at the bottom.
</p>
        <blockquote>
          <blockquote>
            <p>
              <img src="http://www.myfriedmind.com/techBlog/content/binary/recoveryCommandPrompt.jpg" border="0" />
            </p>
          </blockquote>
        </blockquote>7 - When the command prompt opens, type "Notepad" to launch
notepad. Note this MIGHT work with Wordpad (type "Write" to launch) but I have not
tried it<br /><p><font color="#ff0000">7a - fyi - if you need to get files off (just in case) you can
put in a USB drive and start transferring files to it. You can either use the command
prompt, or the File/Open dialog of Notepad to move the files...</font><br /></p><p>
8 - You are going to be looking for the pending.xml file for the installation. Please
note that it might be on D: not C: because of the System partition that Windows 7
sets aside.<font color="#ff0000"> DO NOT FREAK OUT IF YOU GO TO C:\ AND THERE IS NO
WINDOWS, GO TO D: IN THIS CASE</font></p><p>
9 - Use File/Open to browse to (either C: or D:, see above) and \windows\winsxs\.
Make sure to have "All Files(*.*)" selected in the bottom right so that you can see
the xml files.
</p><blockquote><blockquote><p><img src="http://www.myfriedmind.com/techBlog/content/binary/openPreview.jpg" border="0" /></p></blockquote></blockquote><p>
10 - Make a copy of pending.xml by dragging it down in the file/open screen (just
because we are paranoid)<br /></p><p>
11 - Open up pending.xml. This will take a LONG time because it is a LARGE file. Just
be grateful Notepad can handle it.
</p><p>
12 - Do a search for 000000000000.cdf-ms. This is the section you are going to remove. 
<br /></p><p>
13 - Delete the section that includes it. In thewoot's directions he has you start
with the &lt;Checkpoint/&gt; file BEFORE it and continue through to the end of the
section that contains it, as he points out, the text may vary slightly... This will
take a while (big file)...<br /></p><blockquote><div>&lt;Checkpoint/&gt;
</div><div>&lt;DeleteFile path="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/&gt;
</div><div>&lt;MoveFile source="\SystemRoot\WinSxS\Temp\PendingRenames\e56db1db48d4cb0199440000b01de419._0000000000000000.cdf-ms"
destination="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/&gt;
</div></blockquote><div></div><p>
14 - SAVE THE PREVIEW.XML FILE!!! This will take a while (big file)...
</p><p>
15 - Close notepad
</p><p>
16 - Exit the command prompt (type 'exit' or just close).
</p><p>
17 - Select Restart...
</p><blockquote><blockquote><p><img src="http://www.myfriedmind.com/techBlog/content/binary/restart.jpg" border="0" /></p></blockquote></blockquote><p>
16 - It may take a bit to boot up. In our case the install 'failed' (woohoo!!!) but
in other cases it might claim to 'succeed' whatever that means at this point...
</p><blockquote><blockquote><p><img src="http://www.myfriedmind.com/techBlog/content/binary/failedInstall.jpg" border="0" /></p></blockquote></blockquote><hr /><p>
So what does this all mean? I know that it is instinctual to blame MSoft, but I suspect
this has to do with a 3rd party changing files. I say this because this installed
fine on a number of boxes but failed on someone who does graphic design. It is quite
simply impossible for MSoft to test all the various scenarios that exist in the entire
world, so I am giving them some slack. As long as they fix it quickly!<br /></p><p>
What are the takeaways that I get out of it? 
<br /></p><ol><li>
ALWAYS testbed your updates. This is a no-brainer, or should be, but sometimes admins
tend to assume that simple because it works 99% of the time it will work 100% and
this simply is not true. I know there is a LOT of other stuff to do, but do not blame
MSoft because they cannot test EVERY SINGLE situation. 
<br /></li><li>
The larger the update the more testing. I installed this on a couple of boxes BEFORE
I rolled it out to my testbed. Then I waited a bit. Because I was so careful I only
had to repair one computer rather than who knows how many...</li><li>
Have a beer... there are far greater catastrophes happening even as you read this,
be grateful that this is not one of them...</li></ol>
Hope that helps...<br /><img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8302c92b-7595-4d8c-8213-692adb5a47de" /></body>
      <title>Windows 7 Sp1 - fatal error c00000034 on install</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,8302c92b-7595-4d8c-8213-692adb5a47de.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/03/16/Windows7Sp1FatalErrorC00000034OnInstall.aspx</link>
      <pubDate>Wed, 16 Mar 2011 16:03:52 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font color="#ff0000"&gt;&lt;b&gt;Due to the number of updates on this issue, I have included
them at the top... below is them is the original blog...&lt;br&gt;
&lt;/b&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#ff0000"&gt;&lt;b&gt;
&lt;br&gt;
&lt;/b&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#ff0000"&gt;&lt;b&gt;Update&lt;/b&gt;&lt;/font&gt;: MSoft has written a vbs script to do the
same as what I have listed below. The main difference is that you do not need to hunt
through pending.xml - look at ht&lt;a href="http://support.microsoft.com/kb/975484"&gt;tp://support.microsoft.com/kb/975484&lt;/a&gt; for
more info.
&lt;/p&gt;
&lt;p&gt;
Update: MSoft has redone how WSUS rolls out w07sp1 - "Packages have been updated to
address a known issue." &lt;a href="http://support.microsoft.com/kb/894199"&gt;http://support.microsoft.com/kb/894199&lt;/a&gt; which
might help this issue. Note that this does not appear to be a change in sp1, but in
the wsus rollout format...
&lt;/p&gt;
&lt;p&gt;
Update: MSoft has released Remote Adminsitration Tools that work with SP1 -&amp;gt; &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Further Notes on issues with w07 sp1 in general: &lt;a href="http://www.infoworld.com/t/microsoft-windows/what-you-need-know-about-windows-7-service-pack-1-699"&gt;http://www.infoworld.com/t/microsoft-windows/what-you-need-know-about-windows-7-service-pack-1-699&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Fur&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Recently rolled out SP1 to our wee test group on WSUS. While it worked for most, one
machine simply refused to boot, giving the BSOD (black screen of death) with "Fatal
Error C0000034" as witnessed below...
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/FatalErrorC0000034.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
Before I lay out what worked for us, let me give credit where credit is due - specifically
to "thewoot" -&amp;gt; &lt;a href="http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/1c9a7151-b48c-4a98-aae7-a4b82682ea8e/#bcabda57-7338-499f-aee2-d708e76df315"&gt;you
can see his post here&lt;/a&gt;. He also mentions that you can send him money via paypal
if you want to say thank you in a practical way - considering the potential costs
to your organization I don't think that is a bad idea at all...
&lt;/p&gt;
&lt;p&gt;
Here are his steps (with some notes of changes...)
&lt;/p&gt;
&lt;p&gt;
1 - Reboot your computer with the Windows 7 disc in the drive
&lt;/p&gt;
&lt;p&gt;
2 - Select "Launch Startup Repair"
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/Recov-1.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
3 - &lt;font color="#ff0000"&gt;!!!&lt;/font&gt; Cancel the "repair"
&lt;/p&gt;
&lt;p&gt;
4 - Click on "Don't Send" (if they don't know by now...)
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/cancelNotification.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
5 - &lt;font color="#ff0000"&gt;!!!!&lt;/font&gt; Click on the link "View advanced options for
recovery and support"
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/AdvancedOptions[1].jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
6 - Click on the "Command Prompt" link at the bottom.
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/recoveryCommandPrompt.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;7 - When the command prompt opens, type "Notepad" to launch
notepad. Note this MIGHT work with Wordpad (type "Write" to launch) but I have not
tried it&lt;br&gt;
&lt;p&gt;
&lt;font color="#ff0000"&gt;7a - fyi - if you need to get files off (just in case) you can
put in a USB drive and start transferring files to it. You can either use the command
prompt, or the File/Open dialog of Notepad to move the files...&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
8 - You are going to be looking for the pending.xml file for the installation. Please
note that it might be on D: not C: because of the System partition that Windows 7
sets aside.&lt;font color="#ff0000"&gt; DO NOT FREAK OUT IF YOU GO TO C:\ AND THERE IS NO
WINDOWS, GO TO D: IN THIS CASE&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
9 - Use File/Open to browse to (either C: or D:, see above) and \windows\winsxs\.
Make sure to have "All Files(*.*)" selected in the bottom right so that you can see
the xml files.
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/openPreview.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
10 - Make a copy of pending.xml by dragging it down in the file/open screen (just
because we are paranoid)&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
11 - Open up pending.xml. This will take a LONG time because it is a LARGE file. Just
be grateful Notepad can handle it.
&lt;/p&gt;
&lt;p&gt;
12 - Do a search for 000000000000.cdf-ms. This is the section you are going to remove. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
13 - Delete the section that includes it. In thewoot's directions he has you start
with the &amp;lt;Checkpoint/&amp;gt; file BEFORE it and continue through to the end of the
section that contains it, as he points out, the text may vary slightly... This will
take a while (big file)...&lt;br&gt;
&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;&amp;lt;Checkpoint/&amp;gt;
&lt;/div&gt;
&lt;div&gt;&amp;lt;DeleteFile path="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/&amp;gt;
&lt;/div&gt;
&lt;div&gt;&amp;lt;MoveFile source="\SystemRoot\WinSxS\Temp\PendingRenames\e56db1db48d4cb0199440000b01de419._0000000000000000.cdf-ms"
destination="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/&amp;gt;
&lt;/div&gt;
&lt;/blockquote&gt; 
&lt;div&gt;
&lt;/div&gt;
&lt;p&gt;
14 - SAVE THE PREVIEW.XML FILE!!! This will take a while (big file)...
&lt;/p&gt;
&lt;p&gt;
15 - Close notepad
&lt;/p&gt;
&lt;p&gt;
16 - Exit the command prompt (type 'exit' or just close).
&lt;/p&gt;
&lt;p&gt;
17 - Select Restart...
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/restart.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;
16 - It may take a bit to boot up. In our case the install 'failed' (woohoo!!!) but
in other cases it might claim to 'succeed' whatever that means at this point...
&lt;/p&gt;
&lt;blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/failedInstall.jpg" border="0"&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;
So what does this all mean? I know that it is instinctual to blame MSoft, but I suspect
this has to do with a 3rd party changing files. I say this because this installed
fine on a number of boxes but failed on someone who does graphic design. It is quite
simply impossible for MSoft to test all the various scenarios that exist in the entire
world, so I am giving them some slack. As long as they fix it quickly!&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
What are the takeaways that I get out of it? 
&lt;br&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
ALWAYS testbed your updates. This is a no-brainer, or should be, but sometimes admins
tend to assume that simple because it works 99% of the time it will work 100% and
this simply is not true. I know there is a LOT of other stuff to do, but do not blame
MSoft because they cannot test EVERY SINGLE situation. 
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
The larger the update the more testing. I installed this on a couple of boxes BEFORE
I rolled it out to my testbed. Then I waited a bit. Because I was so careful I only
had to repair one computer rather than who knows how many...&lt;/li&gt;
&lt;li&gt;
Have a beer... there are far greater catastrophes happening even as you read this,
be grateful that this is not one of them...&lt;/li&gt;
&lt;/ol&gt;
Hope that helps...&lt;br&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8302c92b-7595-4d8c-8213-692adb5a47de" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,8302c92b-7595-4d8c-8213-692adb5a47de.aspx</comments>
      <category>Windows 7</category>
      <category>WSUS</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=97884751-c782-4be6-9e5f-72139fc069ec</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,97884751-c782-4be6-9e5f-72139fc069ec.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,97884751-c782-4be6-9e5f-72139fc069ec.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=97884751-c782-4be6-9e5f-72139fc069ec</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Recently a client tried to use a program I wrote years ago on their new 64-bit Windows
7 box. It popped up the error "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered
on the local machine." After some quick digging I discovered that the issue is that
issue is that the 64-bit version of windows does not like the 32-bit version of the
Jet Database...
</p>
        <p>
My solution was to simply repackage the product to have the Platform Target be x86
(see image below) in the properties for the program. This allowed it to run on Windows
7 with no error.
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/platformTargetx86.jpg" border="0" />
        </p>
        <p>
Please note that if there are other things that can trigger this - esp running an
app in IIS - look at <a href="http://blog.nkadesign.com/2008/windows-2008-the-microsoftjetoledb40-provider-is-not-registered-on-the-local-machine/">http://blog.nkadesign.com/2008/windows-2008-the-microsoftjetoledb40-provider-is-not-registered-on-the-local-machine/</a> if
this is not the issue...
</p>
        <p>
Happy coding...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=97884751-c782-4be6-9e5f-72139fc069ec" />
      </body>
      <title>The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. error on Windows 7</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,97884751-c782-4be6-9e5f-72139fc069ec.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/03/11/TheMicrosoftJetOLEDB40ProviderIsNotRegisteredOnTheLocalMachineErrorOnWindows7.aspx</link>
      <pubDate>Fri, 11 Mar 2011 17:36:02 GMT</pubDate>
      <description>&lt;p&gt;
Recently a client tried to use a program I wrote years ago on their new 64-bit Windows
7 box. It popped up the error "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered
on the local machine." After some quick digging I discovered that the issue is that
issue is that the 64-bit version of windows does not like the 32-bit version of the
Jet Database...
&lt;/p&gt;
&lt;p&gt;
My solution was to simply repackage the product to have the Platform Target be x86
(see image below) in the properties for the program. This allowed it to run on Windows
7 with no error.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/platformTargetx86.jpg" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
Please note that if there are other things that can trigger this - esp running an
app in IIS - look at &lt;a href="http://blog.nkadesign.com/2008/windows-2008-the-microsoftjetoledb40-provider-is-not-registered-on-the-local-machine/"&gt;http://blog.nkadesign.com/2008/windows-2008-the-microsoftjetoledb40-provider-is-not-registered-on-the-local-machine/&lt;/a&gt; if
this is not the issue...
&lt;/p&gt;
&lt;p&gt;
Happy coding...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=97884751-c782-4be6-9e5f-72139fc069ec" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,97884751-c782-4be6-9e5f-72139fc069ec.aspx</comments>
      <category>c#</category>
      <category>Coding Tricks</category>
      <category>VB.Net</category>
      <category>Windows 7</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
You ever want to set your Login system to automatically unlock users after a set period
of time? Well, now you can...
</p>
        <p>
I wish I could take all the credit for this, but I can't...
</p>
        <p>
:)
</p>
        <p>
I snagged this from <a href="http://www.aspnettutorials.com/tutorials/controls/lock-unlock-user-asp4-csharp.aspx">http://www.aspnettutorials.com/tutorials/controls/lock-unlock-user-asp4-csharp.aspx</a>.
The only variation I made was to use an AppSetting to store the number of minutes
to wait and then use that to determine the length.
</p>
So - my variation<p>
In Web.Config
</p><p>
  &lt;appSettings&gt;<br />
    &lt;!-- Enter in the number of minutes to lock out an account.
-1 means do not unlock except manually by administrator --&gt;<br />
    &lt;add key="PasswordLockoutMinutes" value="15"/&gt;<br />
  &lt;/appSettings&gt;<br /></p><p>
In Global.asax (to set the Application Variable)<br /></p><p>
    void Application_Start(object sender, EventArgs e) 
<br />
    {<br />
        int _minutesToLockout = -1; // default
is no unlocking<br />
        string _passwordLockoutMinutes = ConfigurationManager.AppSettings["PasswordLockoutMinutes"];<br />
        Int32.TryParse(_passwordLockoutMinutes,
out _minutesToLockout);<br />
        Application["PasswordLockoutMinutes"] =
_minutesToLockout;<br />
    }
</p><p>
On my login usercontrol
</p><p>
     &lt;asp:Login ID="uxLogin" runat="server" OnLoggingIn="uxLogin_LoggingIn"
.../&gt;
</p><p>
In my codebehind for the login control
</p><p>
   protected void uxLogin_LoggingIn(object sender, LoginCancelEventArgs
e)<br />
    {<br />
        Login _login = (Login)sender;<br /><br />
        // unlock if appropriate<br />
        MembershipUser _user = Membership.GetUser(_login.UserName);<br />
        if (_user != null &amp;&amp; _user.IsLockedOut)<br />
        {<br />
            int _minutesToLockout
= (int)Application["PasswordLockoutMinutes"];<br /><br />
            if (_minutesToLockout
&gt; -1)<br />
            {<br />
               
int _remainingLockMinutes =<br />
                   
Convert.ToInt32(Math.Floor(_user.LastLockoutDate.AddMinutes(_minutesToLockout).Subtract(DateTime.Now).TotalMinutes));<br />
               
if (_remainingLockMinutes &gt; 0)<br />
               
{<br />
                   
_login.FailureText =<br />
                       
String.Format("You have been temporarily locked out due to too many faulty passwords.
You will be unlocked automatically in {0} minutes.",<br />
                       
_remainingLockMinutes);<br />
               
}<br />
               
else<br />
               
{<br />
                   
_user.UnlockUser();<br />
               
}<br />
            }<br />
            else<br />
            {<br />
               
_login.FailureText =<br />
                   
"You have been locked out due to too many faulty passwords. Please use the contact
the administrator to unlock your account.";<br />
            }<br />
        }<br /><br />
    }<br /></p><p>
Hope that helps...<br /></p><p><br /></p><img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3" /></body>
      <title>How to automatically unlock fba passwords after a set period of time...</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/02/23/HowToAutomaticallyUnlockFbaPasswordsAfterASetPeriodOfTime.aspx</link>
      <pubDate>Wed, 23 Feb 2011 17:20:13 GMT</pubDate>
      <description>&lt;p&gt;
You ever want to set your Login system to automatically unlock users after a set period
of time? Well, now you can...
&lt;/p&gt;
&lt;p&gt;
I wish I could take all the credit for this, but I can't...
&lt;/p&gt;
&lt;p&gt;
:)
&lt;/p&gt;
&lt;p&gt;
I snagged this from &lt;a href="http://www.aspnettutorials.com/tutorials/controls/lock-unlock-user-asp4-csharp.aspx"&gt;http://www.aspnettutorials.com/tutorials/controls/lock-unlock-user-asp4-csharp.aspx&lt;/a&gt;.
The only variation I made was to use an AppSetting to store the number of minutes
to wait and then use that to determine the length.
&lt;/p&gt;
So - my variation&lt;p&gt;
In Web.Config
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp; &amp;lt;appSettings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Enter in the number of minutes to lock out an account.
-1 means do not unlock except manually by administrator --&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="PasswordLockoutMinutes" value="15"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/appSettings&amp;gt;&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
In Global.asax (to set the Application Variable)&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void Application_Start(object sender, EventArgs e) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int _minutesToLockout = -1; // default
is no unlocking&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string _passwordLockoutMinutes = ConfigurationManager.AppSettings["PasswordLockoutMinutes"];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Int32.TryParse(_passwordLockoutMinutes,
out _minutesToLockout);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application["PasswordLockoutMinutes"] =
_minutesToLockout;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p&gt;
On my login usercontrol
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Login ID="uxLogin" runat="server" OnLoggingIn="uxLogin_LoggingIn"
.../&amp;gt;
&lt;/p&gt;
&lt;p&gt;
In my codebehind for the login control
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp; protected void uxLogin_LoggingIn(object sender, LoginCancelEventArgs
e)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Login _login = (Login)sender;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // unlock if appropriate&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MembershipUser _user = Membership.GetUser(_login.UserName);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_user != null &amp;amp;&amp;amp; _user.IsLockedOut)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int _minutesToLockout
= (int)Application["PasswordLockoutMinutes"];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_minutesToLockout
&amp;gt; -1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
int _remainingLockMinutes =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Convert.ToInt32(Math.Floor(_user.LastLockoutDate.AddMinutes(_minutesToLockout).Subtract(DateTime.Now).TotalMinutes));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if (_remainingLockMinutes &amp;gt; 0)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_login.FailureText =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
String.Format("You have been temporarily locked out due to too many faulty passwords.
You will be unlocked automatically in {0} minutes.",&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_remainingLockMinutes);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_user.UnlockUser();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
_login.FailureText =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
"You have been locked out due to too many faulty passwords. Please use the contact
the administrator to unlock your account.";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Hope that helps...&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,c4022c5c-12b4-4b76-a09d-9cc0f9e18cb3.aspx</comments>
      <category>c#</category>
      <category>Coding Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is just a quick post for those of you who want a simple way to dig through the
GAC to snag an assembly for your coding. I was inspired by this <a href="http://weblogs.asp.net/jgalloway/archive/2006/11/07/Handling-_2200_GO_2200_-Separators-in-SQL-Scripts-_2D00_-the-easy-way.aspx">post </a>while
creating a website that needed to populate a series of Stored Procedures. Rather than
load each one individually, I wanted a simple way to store them all in one text file
which I could then access.
</p>
        <p>
So I wanted to use Microsoft.SqlServer.SMOExtended. So I needed to get into my GAC
(since I already had sql08 installed).
</p>
        <p>
You probably know that your GAC is actually your %windir%\assembly folder (ex c:\windows\assembly).
And there are undoubtedly a number of nice utilities for extracting the particular
file you want, but I tend to be too impatient for that.
</p>
        <p>
My solution is simply to open up a cmd prompt and go get that file. Each file is stored
in a subdirectory that references its base identity (at least that is what I call
it), then its namespace, then its version level. Something like %windir%\assembly\%base
identity%\%namespace%\%version%\%filename%.dll
</p>
        <p>
I still like to use attrib /s to look for files quickly from the cmd prompt - so this
is what I did...
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/gettingSmoGac.jpg" border="0" />
        </p>
        <p>
I could then snag that dll from the root of C: and add it to my project.
</p>
        <p>
I should note (of course) that these particular dlls can be gotten much easier by
simply going into the SDK subfolder of the Sql Server install... &lt;g&gt;<br /></p>
        <p>
Hope that helps...
</p>
        <p>
;)<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4" />
      </body>
      <title>Accessing Assemblies stored in the GAC</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/02/14/AccessingAssembliesStoredInTheGAC.aspx</link>
      <pubDate>Mon, 14 Feb 2011 21:56:48 GMT</pubDate>
      <description>&lt;p&gt;
This is just a quick post for those of you who want a simple way to dig through the
GAC to snag an assembly for your coding. I was inspired by this &lt;a href="http://weblogs.asp.net/jgalloway/archive/2006/11/07/Handling-_2200_GO_2200_-Separators-in-SQL-Scripts-_2D00_-the-easy-way.aspx"&gt;post &lt;/a&gt;while
creating a website that needed to populate a series of Stored Procedures. Rather than
load each one individually, I wanted a simple way to store them all in one text file
which I could then access.
&lt;/p&gt;
&lt;p&gt;
So I wanted to use Microsoft.SqlServer.SMOExtended. So I needed to get into my GAC
(since I already had sql08 installed).
&lt;/p&gt;
&lt;p&gt;
You probably know that your GAC is actually your %windir%\assembly folder (ex c:\windows\assembly).
And there are undoubtedly a number of nice utilities for extracting the particular
file you want, but I tend to be too impatient for that.
&lt;/p&gt;
&lt;p&gt;
My solution is simply to open up a cmd prompt and go get that file. Each file is stored
in a subdirectory that references its base identity (at least that is what I call
it), then its namespace, then its version level. Something like %windir%\assembly\%base
identity%\%namespace%\%version%\%filename%.dll
&lt;/p&gt;
&lt;p&gt;
I still like to use attrib /s to look for files quickly from the cmd prompt - so this
is what I did...
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/gettingSmoGac.jpg" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
I could then snag that dll from the root of C: and add it to my project.
&lt;/p&gt;
&lt;p&gt;
I should note (of course) that these particular dlls can be gotten much easier by
simply going into the SDK subfolder of the Sql Server install... &amp;lt;g&amp;gt;&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Hope that helps...
&lt;/p&gt;
&lt;p&gt;
;)&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,15d7ae1f-cb6d-4a38-a7d7-681d1d81abe4.aspx</comments>
      <category>Coding Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=4bf3022c-0abe-4311-bf8b-ae07ea5cffa4</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,4bf3022c-0abe-4311-bf8b-ae07ea5cffa4.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,4bf3022c-0abe-4311-bf8b-ae07ea5cffa4.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=4bf3022c-0abe-4311-bf8b-ae07ea5cffa4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have just upgraded my desktop, and so decided to install Office 2010 (why not?)
rather than keep the old Office 2007 I had. This is especially important because InfoPath
forms on Sharepoint 2010 are in InfoPath 2010. And of course, more the fool me, I
decided to go 64-bit. After all - my machine is 64-bit; Sharepoint 2010 is 64-bit
- why wouldn't I?<br /></p>
        <p>
The answer is in the error message below, which I received when I tried to open a
simple SP2010 List in Datasheet view
</p>
        <p>
          <img src="http://www.myfriedmind.com/techBlog/content/binary/sp10datasheeterror.jpg" border="0" />
        </p>
        <p>
This is triggered, so I gather, from the fact that my Office 2010 is 64-bit, and Sharepoint
2010, although being a 64-bit version, only talks 32-bit to its clients. 
<br /></p>
        <p>
Now before you pull out your hair and go on a rant about how STUPID Microsoft appears
to be in doing this, Let me assure you there is a simple workaround. You simply need
to install the "2007 Office System Driver: Data Connectivity Components". You can
get that at <a href="http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891" target="_blank">http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891</a>.
</p>
        <p>
If you still want something to rant over - read the KB article that suggests this
at <a href="http://support.microsoft.com/kb/2266203">http://support.microsoft.com/kb/2266203</a>,
specifically the part (and I quote) "...we recommend that you uninstall the 64-bit
version of Office 2010 and install the 32-bit version of Office 2010."
</p>
        <p>
I have been very impressed with Sharepoint 2010 and am busy coding my little heart
out, but THIS is just plain dumb...<br /></p>
        <img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=4bf3022c-0abe-4311-bf8b-ae07ea5cffa4" />
      </body>
      <title>Sharepoint 2010 - The list can not be displayed in Datasheet view for one or more of the following reasons:</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,4bf3022c-0abe-4311-bf8b-ae07ea5cffa4.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2011/02/04/Sharepoint2010TheListCanNotBeDisplayedInDatasheetViewForOneOrMoreOfTheFollowingReasons.aspx</link>
      <pubDate>Fri, 04 Feb 2011 20:51:23 GMT</pubDate>
      <description>&lt;p&gt;
I have just upgraded my desktop, and so decided to install Office 2010 (why not?)
rather than keep the old Office 2007 I had. This is especially important because InfoPath
forms on Sharepoint 2010 are in InfoPath 2010. And of course, more the fool me, I
decided to go 64-bit. After all - my machine is 64-bit; Sharepoint 2010 is 64-bit
- why wouldn't I?&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
The answer is in the error message below, which I received when I tried to open a
simple SP2010 List in Datasheet view
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.myfriedmind.com/techBlog/content/binary/sp10datasheeterror.jpg" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
This is triggered, so I gather, from the fact that my Office 2010 is 64-bit, and Sharepoint
2010, although being a 64-bit version, only talks 32-bit to its clients. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Now before you pull out your hair and go on a rant about how STUPID Microsoft appears
to be in doing this, Let me assure you there is a simple workaround. You simply need
to install the "2007 Office System Driver: Data Connectivity Components". You can
get that at &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
If you still want something to rant over - read the KB article that suggests this
at &lt;a href="http://support.microsoft.com/kb/2266203"&gt;http://support.microsoft.com/kb/2266203&lt;/a&gt;,
specifically the part (and I quote) "...we recommend that you uninstall the 64-bit
version of Office 2010 and install the 32-bit version of Office 2010."
&lt;/p&gt;
&lt;p&gt;
I have been very impressed with Sharepoint 2010 and am busy coding my little heart
out, but THIS is just plain dumb...&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=4bf3022c-0abe-4311-bf8b-ae07ea5cffa4" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,4bf3022c-0abe-4311-bf8b-ae07ea5cffa4.aspx</comments>
      <category>Office 2010</category>
      <category>Sharepoint 2010</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=8dec1e6b-ff99-4231-bec0-874084e7fd48</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,8dec1e6b-ff99-4231-bec0-874084e7fd48.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,8dec1e6b-ff99-4231-bec0-874084e7fd48.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=8dec1e6b-ff99-4231-bec0-874084e7fd48</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">This is just a quick entry because I am
swamped, but I wanted to get this out. I wish I had a copy of where I got this from,
it in was in a newsgroup, but I am afraid I do not, so the genius who figured this
out will have to go unnamed. Sorry.<br /><br />
Basically when you use Fiddler (one of my all time favorite programs) it refuses to
proxy localhost by default. You can try wiping it out in options (I did) but it does
not seem to 'take'.<br /><br />
The solution is embarrassingly simply, you simply add a period after the word localhost
so<br /><br />
http://localhost/mypage.aspx becomes http://localhost./mypage.aspx. 
<br /><br />
You computer resolves it without a glitch and you trick Fiddler into reporting what
is going on...<br /><p></p><img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8dec1e6b-ff99-4231-bec0-874084e7fd48" /></body>
      <title>Using Fiddler with LocalHost</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,8dec1e6b-ff99-4231-bec0-874084e7fd48.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2010/12/10/UsingFiddlerWithLocalHost.aspx</link>
      <pubDate>Fri, 10 Dec 2010 21:53:01 GMT</pubDate>
      <description>This is just a quick entry because I am swamped, but I wanted to get this out. I wish I had a copy of where I got this from, it in was in a newsgroup, but I am afraid I do not, so the genius who figured this out will have to go unnamed. Sorry.&lt;br&gt;
&lt;br&gt;
Basically when you use Fiddler (one of my all time favorite programs) it refuses to
proxy localhost by default. You can try wiping it out in options (I did) but it does
not seem to 'take'.&lt;br&gt;
&lt;br&gt;
The solution is embarrassingly simply, you simply add a period after the word localhost
so&lt;br&gt;
&lt;br&gt;
http://localhost/mypage.aspx becomes http://localhost./mypage.aspx. 
&lt;br&gt;
&lt;br&gt;
You computer resolves it without a glitch and you trick Fiddler into reporting what
is going on...&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=8dec1e6b-ff99-4231-bec0-874084e7fd48" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,8dec1e6b-ff99-4231-bec0-874084e7fd48.aspx</comments>
      <category>Coding Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.myfriedmind.com/techBlog/Trackback.aspx?guid=6be5ec55-63e5-4d61-b25d-2db0f4341964</trackback:ping>
      <pingback:server>http://www.myfriedmind.com/techBlog/pingback.aspx</pingback:server>
      <pingback:target>http://www.myfriedmind.com/techBlog/PermaLink,guid,6be5ec55-63e5-4d61-b25d-2db0f4341964.aspx</pingback:target>
      <dc:creator>papabear</dc:creator>
      <wfw:comment>http://www.myfriedmind.com/techBlog/CommentView,guid,6be5ec55-63e5-4d61-b25d-2db0f4341964.aspx</wfw:comment>
      <wfw:commentRss>http://www.myfriedmind.com/techBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=6be5ec55-63e5-4d61-b25d-2db0f4341964</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">One of the vast improvements in Sp10 is
that when you add a lookup column to a list it can drag along additional fields that
it is tied to. In Sp07 you had to use a third-party product to get the same results.
In the RTM version of Sp10 you could include columns that were 'Choice' columns, but
this is no longer the case. In fact you can not use a 'Choice' field at all.<br /><br />
This is a 'known issue' per Lily Wu (from Aug 31, 2010) -&gt; <a href="http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5a80988a-6b37-4454-957b-856ea16b2e60" target="_blank">http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5a80988a-6b37-4454-957b-856ea16b2e60</a><br /><br />
I apologize for taking so long to get around to it, but I have a post that discusses
how to write code to do this -&gt; <a href="http://www.myfriedmind.com/techBlog/2011/08/04/Sharepoint2010HowToUseListEventsToSetAColumnsValueUsingVisualStudio2010C.aspx">http://www.myfriedmind.com/techBlog/2011/08/04/Sharepoint2010HowToUseListEventsToSetAColumnsValueUsingVisualStudio2010C.aspx</a><br /><br />
Hope this helps...<br /><p></p><img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=6be5ec55-63e5-4d61-b25d-2db0f4341964" /></body>
      <title>Sharepoint 2010 Lookup Fields will not allow Choice column</title>
      <guid isPermaLink="false">http://www.myfriedmind.com/techBlog/PermaLink,guid,6be5ec55-63e5-4d61-b25d-2db0f4341964.aspx</guid>
      <link>http://www.myfriedmind.com/techBlog/2010/12/01/Sharepoint2010LookupFieldsWillNotAllowChoiceColumn.aspx</link>
      <pubDate>Wed, 01 Dec 2010 19:49:09 GMT</pubDate>
      <description>One of the vast improvements in Sp10 is that when you add a lookup column to a list it can drag along additional fields that it is tied to. In Sp07 you had to use a third-party product to get the same results. In the RTM version of Sp10 you could include columns that were 'Choice' columns, but this is no longer the case. In fact you can not use a 'Choice' field at all.&lt;br&gt;
&lt;br&gt;
This is a 'known issue' per Lily Wu (from Aug 31, 2010) -&amp;gt; &lt;a href="http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5a80988a-6b37-4454-957b-856ea16b2e60" target="_blank"&gt;http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5a80988a-6b37-4454-957b-856ea16b2e60&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
I apologize for taking so long to get around to it, but I have a post that discusses
how to write code to do this -&amp;gt; &lt;a href="http://www.myfriedmind.com/techBlog/2011/08/04/Sharepoint2010HowToUseListEventsToSetAColumnsValueUsingVisualStudio2010C.aspx"&gt;http://www.myfriedmind.com/techBlog/2011/08/04/Sharepoint2010HowToUseListEventsToSetAColumnsValueUsingVisualStudio2010C.aspx&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Hope this helps...&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.myfriedmind.com/techBlog/aggbug.ashx?id=6be5ec55-63e5-4d61-b25d-2db0f4341964" /&gt;</description>
      <comments>http://www.myfriedmind.com/techBlog/CommentView,guid,6be5ec55-63e5-4d61-b25d-2db0f4341964.aspx</comments>
      <category>Sharepoint 2010</category>
    </item>
  </channel>
</rss>
