<?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:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>StuffThatJustWorks.com</title>
    <link>http://www.stuffthatjustworks.com/</link>
    <description>Cal Zant's Blog</description>
    <language>en-us</language>
    <copyright>Cal Zant</copyright>
    <lastBuildDate>Thu, 29 Mar 2012 15:00:31 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>calzant@gmail.com</managingEditor>
    <webMaster>calzant@gmail.com</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/StuffThatJustWorks" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="stuffthatjustworks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=18502c2f-ebcc-4e35-bd7e-e8cabedc5497</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,18502c2f-ebcc-4e35-bd7e-e8cabedc5497.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To Use Conditional Aggregates In T-SQL</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,18502c2f-ebcc-4e35-bd7e-e8cabedc5497.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToUseConditionalAggregatesInTSQL.aspx</link>
      <pubDate>Thu, 29 Mar 2012 15:00:31 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I found this neat little T-SQL trick recently that was really useful. It is essentially&#xD;
a way to perform a conditional aggregate (i.e. SUM, COUNT, AVG, etc) in MS SQL Server&#xD;
2008 using a nested CASE statement. Here is an example of how to use it based on the&#xD;
old Northwind database (yes ... Northwind, keepin' it real). &#xD;
&lt;/p&gt;&#xD;
        &lt;img src="http://www.stuffthatjustworks.com/content/binary/Conditional Aggregate T-SQL Example.png" alt="Conditional Aggregate T-SQL Example"&gt;&lt;/img&gt;&#xD;
        &lt;p style="font-family:Courier New;" class="code"&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;pre&gt;&#xD;
SELECT  SUM(UnitsInStock) AS TotalInventory,&#xD;
        SUM(CASE&#xD;
		WHEN UnitPrice &amp;gt; 20 THEN 1&#xD;
		ELSE 0&#xD;
	    END) AS TotalInventoryOfItemsWithPriceOver20&#xD;
FROM	Products&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
Just in case you don't remember what the Northwind products data looked like, here&#xD;
is an example of the underlying data this query is running against: &#xD;
&lt;/p&gt;&#xD;
        &lt;img src="http://www.stuffthatjustworks.com/content/binary/Northwind Products Data.png"&gt;&lt;/img&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=18502c2f-ebcc-4e35-bd7e-e8cabedc5497"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=IQHzvh1hw0g:zia0AHJQQiE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=IQHzvh1hw0g:zia0AHJQQiE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=IQHzvh1hw0g:zia0AHJQQiE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=28c68354-e85b-4037-81dd-e6103a0120cb</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,28c68354-e85b-4037-81dd-e6103a0120cb.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To Pass Multivalue Report Parameters To Subreports In Report Builder</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,28c68354-e85b-4037-81dd-e6103a0120cb.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToPassMultivalueReportParametersToSubreportsInReportBuilder.aspx</link>
      <pubDate>Wed, 28 Mar 2012 23:57:48 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I was stuck on this for a while, because a Google search didn’t really turn up anything&#xD;
relevant for this. I essentially had a report containing many subreports. The base&#xD;
report had a multivalue parameter that I wanted to pass down to each of the subreports,&#xD;
so they displayed the data to match the selected parameter. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here is how the multivalue report parameter was configured on the top-level report: &#xD;
&lt;/p&gt;&#xD;
        &lt;img src="http://www.stuffthatjustworks.com/content/binary/Report Parameter Properties for Multivalue.png" alt="Report Parameter Properties for Multivalue"&gt;&lt;/img&gt;&#xD;
        &lt;p&gt;&#xD;
Passing standard, single-value parameters to subreports is typically very straight-forward.&#xD;
You can just drop the subreport on the page, right-click on it, go to &lt;strong&gt;Subreport&#xD;
Properties…&lt;/strong&gt;, and click on the &lt;strong&gt;Parameters&lt;/strong&gt; section. Here is&#xD;
a basic example of how you would pass two simple date parameters to the subreport&#xD;
(they have identical names on both the parent and subreport): &#xD;
&lt;/p&gt;&#xD;
        &lt;img src="http://www.stuffthatjustworks.com/content/binary/Typical Way To Pass Parameters To Subreports.png" alt="Typical Way To Pass Parameters To Subreports"&gt;&lt;/img&gt;&#xD;
        &lt;p&gt;&#xD;
However, you can’t do that with a multi-value parameter. I eventually learned the&#xD;
trick is related to how the values are serialized and so they are presented to the&#xD;
subreport in the expected format. Essentially it must be passed as an array of strings&#xD;
if you want the subreport to understand it, and you need to write a short expression&#xD;
to do that: &#xD;
&lt;/p&gt;&#xD;
        &lt;img src="http://www.stuffthatjustworks.com/content/binary/Subreport Properties with Serialized Values.png" alt="Subreport Properties with Serialized Values"&gt;&lt;/img&gt;&#xD;
        &lt;p&gt;&#xD;
=Split(Join(Parameters!RegionIDs.Value,","),",") &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
We will break down what the script is doing and why it works: &#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Parameters!RegionIDs.Value&lt;/strong&gt; = By default this call by itself will&#xD;
result in an error (yeah, not what you might expect). If you tried something like&#xD;
Parameters!RegionIDs.Value(0) it would work, but you would only get the first value&#xD;
selected and if none were selected you would get an error. Apparently at this level&#xD;
the value is pretty useless, but stick with me. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Join(--Results From #1--,",")&lt;/strong&gt; = This will essentially convert whatever&#xD;
the original data type was into a comma-separated string of the selected values. Since&#xD;
my example was a bunch of integers, the value of this statement might produce something&#xD;
like “1,2,6”. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Split(--Results From #2--,",")&lt;/strong&gt; = This will convert convert that comma-separated&#xD;
string (e.g. “1,2,6”) back out into an array, but this time it is an array of strings.&#xD;
I’m not sure what the data type was of the original array, but apparently it wasn’t&#xD;
something the subreport report was expecting. But by converting it to an array of&#xD;
strings, the subreport should work as expected now. &#xD;
&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
Here is a good resource for more info on using parameters: &lt;a href="http://technet.microsoft.com/en-us/library/dd207127(v=sql.100).aspx"&gt;http://technet.microsoft.com/en-us/library/dd207127(v=sql.100).aspx&lt;/a&gt;&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=28c68354-e85b-4037-81dd-e6103a0120cb"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=VWo-Xakm2Zk:RbROlYHGNhU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=VWo-Xakm2Zk:RbROlYHGNhU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=VWo-Xakm2Zk:RbROlYHGNhU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=2d59b0a4-a5b9-4e60-9982-8f95151adf00</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,2d59b0a4-a5b9-4e60-9982-8f95151adf00.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To Fix: SQL 2008 Error - Saving changes is not permitted.  You have enabled the option to Prevent saving changes that require the table to re-created.</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,2d59b0a4-a5b9-4e60-9982-8f95151adf00.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToFixSQL2008ErrorSavingChangesIsNotPermittedYouHaveEnabledTheOptionToPreventSavingChangesThatRequireTheTableToRecreated.aspx</link>
      <pubDate>Tue, 21 Dec 2010 20:15:57 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I ran into this issue a few times, and finally decided to figure out what was going&#xD;
on.  Apparently in SQL Server 2008 they made some changes to the default behavior&#xD;
of the designer, so that it didn't apply any changes that required a table to recreated. &#xD;
This was primarily changed because when a change is made that does&#xD;
require the table to be recreated, SQL has to copy all of the data already&#xD;
in that table to a temporary location, recreate the table with the new&#xD;
changes applied, and then copy the data back over from the temporary location. &#xD;
If the table contains a large amount of data this can take some time, and essentially&#xD;
freezes up management studio while it executes.  So their fix was to just&#xD;
make that behavior disabled by default, and require users to opt-in if they&#xD;
needed it.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here is the error message window it shows when this is your problem:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;em&gt;Saving changes is not permitted.  The changes you have made require the following&#xD;
tables to be dropped and re-created.  You have either made changes to a table&#xD;
that can't be re-created or enabled the option Prevent saving changes that require&#xD;
the table to be re-created.&lt;/em&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;img border="0" src="http://www.stuffthatjustworks.com/content/binary/SQL 2008 Alert Error Message saving changes is not permitted enabled the option prevent saving changes.png"&gt;&lt;/img&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
The fix is to just go disable that option, and to do that you just go to &lt;strong&gt;Tools&#xD;
&amp;gt; Options&lt;/strong&gt; in SQL Management Studio.  Then click on the &lt;strong&gt;Designer&lt;/strong&gt; section.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" src="http://www.stuffthatjustworks.com/content/binary/SQL 2008 enabled the option prevent saving changes that require table re-creation.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Unselect the checkbox with the text "Prevent saving changes that require table re-creation"&#xD;
as shown above, and click &lt;strong&gt;OK&lt;/strong&gt;.  Try to re-save the changes to&#xD;
your table, and it should work.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=2d59b0a4-a5b9-4e60-9982-8f95151adf00"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=7J5mMcLKFBw:vFKj9kvTlpM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=7J5mMcLKFBw:vFKj9kvTlpM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=7J5mMcLKFBw:vFKj9kvTlpM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=59f69fbb-617c-4ec1-ab07-aad31f23ec7b</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,59f69fbb-617c-4ec1-ab07-aad31f23ec7b.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Control Your ViewState in ASP.NET 4.0 (EnableViewState vs. ViewStateMode)</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,59f69fbb-617c-4ec1-ab07-aad31f23ec7b.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToControlYourViewStateInASPNET40EnableViewStateVsViewStateMode.aspx</link>
      <pubDate>Fri, 23 Jul 2010 20:06:36 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
One of the biggest drawbacks of using ASP.NET is the way it can really bloat a page&#xD;
size with ViewState.  That is because http and the web in general are&#xD;
stateless by nature, but when creating applications developers often need to&#xD;
track what changed on a form ... hence ViewState was introduced to essentially&#xD;
let the development code as if the web was stateful.  Although some left-wing&#xD;
purist might argue, my more pragmatic nature causes me to think this was&#xD;
a good thing overall because of the dramatic increase in productivity it offers. &#xD;
However, the downside was bloated pages to the client ... but now ASP.NET 4.0 offers&#xD;
a better way to control that.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Pre 4.0, ASP.NET offered the EnableViewState property which you could put on a page&#xD;
or control.  If you set that value to false, it disabled all viewstate for that&#xD;
control and any child controls.  The problem was you didn't have the ability&#xD;
to override that behavior in any of the child controls.  So this was more&#xD;
of a system where it had to be enabled at a high level, but then disabled in an opt-out&#xD;
fashion where you didn't really need it.  The result was that people just didn't&#xD;
opt-out.  That isn't because they were lazy (well, not completely) ... its just&#xD;
that pattern doesn't encourage good practices.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
ASP.NET 4.0 includes a new ViewStateMode property that is completely different than&#xD;
EnableViewState.  It allows you to set the overall viewstate for a site off by&#xD;
default, but that can be overridden at any level below that.  This creates an&#xD;
opt-in pattern.  When I first tried to confige this setup, I ran into a few problems&#xD;
because I was trying to mix EnableViewState with ViewStateMode.&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;EnableViewState&#xD;
always trumps the ViewStateMode setting.  I think it is much simpler to&#xD;
not mix the two and just avoid the old school EnableViewState property all&#xD;
together, and solely rely on ViewStateMode to control your ViewState.&lt;/strong&gt;&lt;/p&gt;&#xD;
        &lt;h2&gt;The ViewState Opt-In Pattern Using ViewStateMode&#xD;
&lt;/h2&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
Set the site's masterpage(s) to have a ViewStateMode setting of "Disabled". &#xD;
Unfortunately you can't set that property at the page level in the web.config, but&#xD;
disabling at the master page level should have a similar site-wide effect.&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;%@ Master Language="C#" ViewStateMode="Disabled" ...&lt;/font&gt;&lt;br&gt;&lt;br&gt;&#xD;
You could optionally set the ViewStateMode="Disabled" on one or more of the content&#xD;
placeholders in your master page:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" ViewStateMode="Disabled"&#xD;
...&lt;/font&gt;&lt;br&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Then, when you need viewstate on a certain page or control ... just set ViewStateMode="Enabled"&#xD;
at that location.  It is usually very obvious when you need this when you are&#xD;
developing the site from scratch, but this type of pattern can be more difficult to&#xD;
retro-fit into an existing app.  Essentially the things that typically need ViewState&#xD;
are controls that you will need to access the values of on a PostBack to the server&#xD;
(e.g. textboxes, drop downs, checkboxes, etc).&lt;br&gt;&lt;br&gt;&#xD;
One tricky thing I have ran into is that you can't set the ViewStateMode at the page&#xD;
level in the Page directive like this (at least when using master pages):&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;%@ Page Title="Dynamic Schedule" ViewStateMode="Enabled"&#xD;
... &lt;strong&gt;&lt;font color="#ff0000"&gt;// WON'T WORK&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br&gt;&#xD;
Instead you should preferrably set it for the individual controls that need it that&#xD;
way only the ViewState data that is required would be sent to/from the client, and&#xD;
the page wouldn't be bloated with unnecessary ViewState data.&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:CheckBoxList ID="cblProducts" ViewStateMode="Enabled"&#xD;
...&lt;/font&gt;&lt;br&gt;&lt;br&gt;&#xD;
If you have many controls that you need to enable ViewState on, and you didn't want&#xD;
to have to set the property on all of them ... you could optionally just enable&#xD;
viewstate for an entire content placeholder section like this:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"&#xD;
ViewStateMode="Enabled" ...&lt;/font&gt;&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
Here are a few more helpful resources on the new ViewStateMode functionality:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.viewstatemode.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.ui.viewstatemode.aspx&lt;/a&gt;&#xD;
          &lt;br&gt;&#xD;
          &lt;a href="http://weblogs.asp.net/sreejukg/archive/2010/04/06/viewstatemode-in-asp-net-4-0.aspx"&gt;http://weblogs.asp.net/sreejukg/archive/2010/04/06/viewstatemode-in-asp-net-4-0.aspx&lt;/a&gt;&#xD;
          &lt;br&gt;&#xD;
          &lt;a href="http://www.mostlylucid.net/archive/2009/01/28/1312.aspx"&gt;http://www.mostlylucid.net/archive/2009/01/28/1312.aspx&lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=59f69fbb-617c-4ec1-ab07-aad31f23ec7b"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=Nn-0aDZaA6E:Vh5PkYou2Uw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=Nn-0aDZaA6E:Vh5PkYou2Uw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=Nn-0aDZaA6E:Vh5PkYou2Uw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=9b99c723-3660-4b3d-ad8f-6f6247886860</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,9b99c723-3660-4b3d-ad8f-6f6247886860.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Search Definitions of All SQL Procedures, Functions, &amp; Views Using T-SQL</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,9b99c723-3660-4b3d-ad8f-6f6247886860.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToSearchDefinitionsOfAllSQLProceduresFunctionsViewsUsingTSQL.aspx</link>
      <pubDate>Tue, 13 Apr 2010 12:45:29 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
This is a T-SQL code snippet I find myself using regularly to find all references&#xD;
to a particular field or table, or search for comments from a particular date. &#xD;
It essentially allows you to search for a keyword in all of the definitions for stored&#xD;
procedures, functions (scalar or table-valued), and views.  It uses some of the&#xD;
built-in methods SQL Server provides for obtaining metadata, which are essentially&#xD;
simplified views of the data contained in system tables like sysobjects and syscolumns. &#xD;
I know this T-SQL script works on SQL Server 2005 &amp;amp; SQL Server 2008, but&#xD;
don't know if the methods it is dependent on were available on previous versions.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;&#xD;
            &lt;strong&gt;DECLARE @Keyword varchar(64)&lt;br&gt;&#xD;
SET @Keyword = '%keyword%'&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;&#xD;
            &lt;strong&gt;(&lt;br&gt;&#xD;
  SELECT  [ROUTINE_TYPE] AS 'Type', [SPECIFIC_NAME] AS 'Name'&lt;br&gt;&#xD;
  FROM  INFORMATION_SCHEMA.ROUTINES&lt;br&gt;&#xD;
  WHERE  [ROUTINE_DEFINITION] LIKE @Keyword&lt;br&gt;&#xD;
 UNION&lt;br&gt;&#xD;
  SELECT  'VIEW' AS 'Type', [TABLE_NAME] AS 'Name'&lt;br&gt;&#xD;
  FROM  INFORMATION_SCHEMA.VIEWS&lt;br&gt;&#xD;
  WHERE  [VIEW_DEFINITION] LIKE @Keyword&lt;br&gt;&#xD;
)&lt;br&gt;&#xD;
ORDER BY [Type], [Name]&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here is an example of the results of the script:&#xD;
&lt;/p&gt;&#xD;
        &lt;img border="0" alt="Search Results of All SQL Defintions for Stored Procedures, Functions, &amp;amp; Views" src="http://www.stuffthatjustworks.com/content/binary/Search Results of T-SQL Script.png"&gt;&lt;/img&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=9b99c723-3660-4b3d-ad8f-6f6247886860"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=I85KcGgNq40:1vZ7y5uTJCQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=I85KcGgNq40:1vZ7y5uTJCQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=I85KcGgNq40:1vZ7y5uTJCQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=187f22ee-fd26-466b-8d5e-073b40eb3809</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,187f22ee-fd26-466b-8d5e-073b40eb3809.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>Default Excel Chart Colors - Easy Colors To Tell Apart</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,187f22ee-fd26-466b-8d5e-073b40eb3809.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/DefaultExcelChartColorsEasyColorsToTellApart.aspx</link>
      <pubDate>Tue, 06 Apr 2010 12:50:28 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
During my career, I have written a few components that used colors to visually encode&#xD;
data.  Recently I found myself looking at a color chart and trying to choose&#xD;
colors that were easy to distinguish from one another ... again.  It seems like&#xD;
I have done that a few times during my career, so this time I wanted to put it to&#xD;
bed for good.  Instead of relying on my unscientific approach, I figured this&#xD;
had to be a problem that someone solved before ... and Excel came to mind.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
When you create a chart in Excel, it automatically assigns each series a different&#xD;
color.  Microsoft almost certainly poured a ton of research/money into this same&#xD;
problem I was trying to solve:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&#xD;
          &lt;h3&gt;Which set of colors are easiest to differentiate from one another?&#xD;
&lt;/h3&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
They probably also took visual disabilities into account, like color blindness (which&#xD;
I have) and poor vision.  So why reinvent the wheel with this stuff?  Here&#xD;
is a pie chart that displays default color series Excel 2007 automatically assigned&#xD;
to a simple pie chart, which includes the HEX and RGB values for each series color:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="Default Excel Color Series Easy Colors To Tell Apart" src="http://www.stuffthatjustworks.com/content/binary/Default%20Excel%20Color%20Series.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;A few things to keep in mind&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
Here is an helpful excerpt from &lt;a href="http://www.amazon.com/dp/0596100167"&gt;Information&#xD;
Dashboard Design&lt;/a&gt; (a very research driven book) on this topic: &lt;em&gt;&lt;font color="#808080" size="3"&gt;"When&#xD;
organizing data into distinct groups using different expressions of any preattentive&#xD;
attribute, you should be careful not to exceed five distinct expressions. ... &lt;strong&gt;When&#xD;
using hue, keep in mind that even though we can easily distinguish more than five&#xD;
hues, short-term memory can't simultaneously retain the meaning of more than about&#xD;
nine in total.&lt;/strong&gt;"&lt;/font&gt;&lt;/em&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
When using colors to visual encode information, think about what it would look like&#xD;
if printed in black and white.  Would you still be able to distinguish between&#xD;
the different series or groups, or would that encoding be lost without color?  Although&#xD;
the project you are working on may never be printed black and white, almost&#xD;
10% of males have some type of color blindness ... so thinking through this&#xD;
scenario can help you understand their perspective.  Usually adding a label&#xD;
(like the numbers in the example above) or patterns (e.g. stripes) in addition&#xD;
to color would be enough to enable someone to make sense of the encoding, even if&#xD;
they aren't able to process it preattentively like the color coding.&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;p&gt;&#xD;
Here is a C# code snippet that I use, which returns a list of the related&#xD;
colors outlined above:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;&#xD;
            &lt;font color="#006400"&gt;/// &amp;lt;summary&amp;gt;&lt;br&gt;&#xD;
/// Returns a list of colors derived from the defaults Excel uses for chart series.&lt;br&gt;&#xD;
/// These colors should be very easy to differentiate from one another.&lt;br&gt;&#xD;
/// &amp;lt;/summary&amp;gt;&lt;/font&gt;&#xD;
            &lt;br&gt;&#xD;
            &lt;strong&gt;public static List&amp;lt;Color&amp;gt; DefaultExcelColors&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
    get&lt;br&gt;&#xD;
    {&lt;br&gt;&#xD;
        return new List&amp;lt;Color&amp;gt;()&lt;br&gt;&#xD;
            {&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(69,114,167),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(170,70,67),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(137,165,78),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(113,88,143),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(65,152,175),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(219,132,61),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(147,169,207),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(209,147,146),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(185,205,150),&lt;br&gt;&#xD;
               &#xD;
Color.FromArgb(169,155,189)&lt;br&gt;&#xD;
            };&lt;br&gt;&#xD;
    }&lt;br&gt;&#xD;
}&lt;/strong&gt;&#xD;
          &lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=187f22ee-fd26-466b-8d5e-073b40eb3809"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=Ozl1eNARtas:U9x9Pl7g8wU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=Ozl1eNARtas:U9x9Pl7g8wU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=Ozl1eNARtas:U9x9Pl7g8wU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=5d1e5dfa-ca14-4e9e-afff-c227e83b02d7</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,5d1e5dfa-ca14-4e9e-afff-c227e83b02d7.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Fix LINQ to SQL DBML Issue "The connection property of the web.config file is missing or incorrect"</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,5d1e5dfa-ca14-4e9e-afff-c227e83b02d7.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToFixLINQToSQLDBMLIssueTheConnectionPropertyOfTheWebconfigFileIsMissingOrIncorrect.aspx</link>
      <pubDate>Wed, 20 Jan 2010 15:22:50 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
A few weeks ago, I started noticing that every time I opened a LINQ to SQL .dbml file&#xD;
in Visual Studio 2008 I would get an alert message that said &lt;em&gt;"The connection property&#xD;
in the web.config file is missing or incorrect.  The connection string from the&#xD;
.dbml file has been used in its place."&lt;/em&gt;&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="The connection property in the web.config file is missing or incorrect" src="http://www.stuffthatjustworks.com/content/binary/Connection%20Property%20in%20the%20web.config%20is%20missing%20or%20incorrect.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The dbml file was configured to reference a connection string in the web.config file,&#xD;
but after I got this alert and clicked OK, Visual Studio would check out the project&#xD;
and add a new Settings.settings file under the Properties folder and generate a new&#xD;
connection string there, and then change the dbml file to reference that instead of&#xD;
the web.config.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="Changes that were automatically applied to the project after I clicked OK" src="http://www.stuffthatjustworks.com/content/binary/New%20Settings%20File.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This would probably be the behavior you would expect if the web.config was really&#xD;
missing the connection string, but in my case the referenced connection string was&#xD;
there and well-formed.  I know this, because the related code was under&#xD;
source control and other developers could open the same dbml file (from the&#xD;
shared code base) and they wouldn't get the alert and everything worked&#xD;
flawlessly.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To me, it seemed like the LINQ to SQL designer on my machine was simply having trouble&#xD;
reading from the configuration file ... so I thought it might be an issue with a particular&#xD;
dll or registry entry.  Another thing that convinced me of this was the fact&#xD;
that when you were in the dbml editor ... under the Connections property on my computer,&#xD;
none of the connection strings from the web.config were included in the drop down&#xD;
to select from.  But, when another developer would look at this on their machine&#xD;
(using the same exact code base and files), their Visual Studio environment would&#xD;
find those connection strings in the web.config and include them in the list to select&#xD;
from.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="Connection Options on my computer containing no references to web.config connection strings" src="http://www.stuffthatjustworks.com/content/binary/What%20I%20See%20As%20Connection%20Options%20(Close%20Up).png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="Connection Options on other computers containing references to web.config connection strings" src="http://www.stuffthatjustworks.com/content/binary/What%20Other%20Developers%20See%20As%20Connection%20Options%20(Close%20Up).png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I figured out that I could just undo the changes to add the new file, and then&#xD;
view the differences of the dbml file's XML and undo the reference change to make&#xD;
it once again reference the web.config instead of the settings file it created ...&#xD;
and that worked fine for a couple weeks, but eventually jumping through those extra&#xD;
hoops that "should just work" got pretty old.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So I first tried to repair my Visual Studio install, but that didn't work.  Next, I&#xD;
completely uninstalled Visual Studio and then re-installed it and the related service&#xD;
packs ... but that didn't work either.  I was about to just format my machine&#xD;
and re-install Windows ... but I thought I would give Microsoft Support&#xD;
a chance, hoping they could help me.  I knew this was an obscure enough&#xD;
problem that they probably wouldn't be much help, but I really hate paving my machine&#xD;
... so it was worth a little time to give them a chance.  After explaining what&#xD;
was going on to a technician, we tried to use ProcMon to figure out what was going&#xD;
on behind the scenes.  We noticed several registry errors, and that further convinced&#xD;
me that the problem was corrupted  or missing registry keys.  The support&#xD;
technician said he would have to look into it more, but I wasn't going to&#xD;
count on them as my only hope for a solution ... so I kept investigating myself.  &lt;strong&gt;Apparently&#xD;
when you uninstall Visual Studio, it doesn't remove all of the registry keys. &#xD;
It also doesn't overwrite them all when you run a repair.&lt;/strong&gt;  It doesn't&#xD;
even remove them all when you remove all the other software that might have hooks&#xD;
or add-ins related to Visual Studio.  So these corrupted or missing registry&#xD;
keys could have persisted through the repair and re-install.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here are some of the issues we noticed in ProcMon (it is a snapshot of what was happening&#xD;
when I would open the dbml file and the pop-up alert would appear, and then I would&#xD;
click OK).  The one highlighted is the what I was guessing was the culprit, because&#xD;
that missed registry key occurred right between the read of the dbml file and the&#xD;
opening the related project (which I am guessing was to create the new settings file). &#xD;
You can ignore the "Fast IO Disallowed" stuff, because that is unrelated.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="Related errors from Process Monitor while opening the LINQ to SQL dbml file" src="http://www.stuffthatjustworks.com/content/binary/ProcMon%20Visual%20Studio%20DevEnv%20Registry%20Errors.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So, although the support technician had actually explicitly advised me &lt;u&gt;not&lt;/u&gt; to&#xD;
do this ... I decided to uninstall Visual Studio (and any other software add-ins that&#xD;
might be related to it), manually delete the related registry keys contained in any&#xD;
folder that appeared related to Visual Studio, and then do a fresh install.  &lt;strong&gt;I&#xD;
never think hacking in the registry is a good solution to a problem, but this was&#xD;
my last ditch effort ... and I was resolved to do a full re-install of Windows if&#xD;
it didn't work.  To my surprise ... &lt;u&gt;it actually worked&lt;/u&gt;.&lt;/strong&gt;&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I can't guarantee this will work for you, or even recommend it ... but here are the&#xD;
registry folder locations I manually deleted:&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;font face="Courier New"&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio&lt;/font&gt;&#xD;
          &lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;font face="Courier New"&gt;HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio&lt;/font&gt;&#xD;
          &lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;font face="Courier New"&gt;HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon&lt;/font&gt;&#xD;
          &lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;font face="Courier New"&gt;HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTAHost&lt;/font&gt;&#xD;
          &lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;p&gt;&#xD;
Hopefully if you are still reading, this is the exact problem you are having and this&#xD;
will work for you as well.  The only thing I can say is ... it worked on my machine,&#xD;
and it saved me from having to completely re-install Windows to fix the problem.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=5d1e5dfa-ca14-4e9e-afff-c227e83b02d7"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=2gyXTTHzdOc:_Vi7ubQZuj4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=2gyXTTHzdOc:_Vi7ubQZuj4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=2gyXTTHzdOc:_Vi7ubQZuj4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=2ac9434a-78ca-4861-9168-72fcfad55055</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,2ac9434a-78ca-4861-9168-72fcfad55055.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Fix Issue With Excel Not Automatically Updating Formula Calculations</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,2ac9434a-78ca-4861-9168-72fcfad55055.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToFixIssueWithExcelNotAutomaticallyUpdatingFormulaCalculations.aspx</link>
      <pubDate>Thu, 14 Jan 2010 16:32:59 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
We recently ran into a problem up at work where people were opening a particular spreadsheet&#xD;
from a network fileshare, which had a lot of formulas that were tied to a few inputs. &#xD;
You would typically change one input cell, and a lot of the other related cells would&#xD;
be recalculated and updated automatically.  However, a wierd issue started occuring&#xD;
where some users would change the input and nothing would happen.  But ... when&#xD;
they saved the worksheet, all of the related calculated cells would be updated at&#xD;
that time.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I think the issue was related to one person opening the spreadsheet on a Mac that&#xD;
was running Office 2008, and when they saved it we noticed it changed a lot of subtle&#xD;
things like the colors or formatting ... but I think it may have also changed the&#xD;
formulas to be manually updated and only automatically updated when the file is saved,&#xD;
which is an Excel Option.  Regardless of how this issue occurred ... here is&#xD;
the fix:&#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
Open Excel, and click on the &lt;img border="0" alt="Microsoft Office Button in Excel" src="http://www.stuffthatjustworks.com/content/binary/Office-Button.png"&gt;&lt;/img&gt; icon&#xD;
in the top left of the window, then go to &lt;strong&gt;Excel Options&lt;/strong&gt;.&lt;br&gt;&lt;img border="0" alt="Open Excel Options dialog" src="http://www.stuffthatjustworks.com/content/binary/Open%20Excel%20Options.png"&gt;&lt;/img&gt;&lt;br&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Then go to the &lt;strong&gt;Formulas&lt;/strong&gt; tab, and change the &lt;strong&gt;Calculation options&lt;/strong&gt; to &lt;strong&gt;Automatic&lt;/strong&gt;,&#xD;
and hit &lt;strong&gt;OK &lt;/strong&gt;to apply the changes.&lt;br&gt;&lt;img border="0" alt="Change formula calculation options to automatic" src="http://www.stuffthatjustworks.com/content/binary/Change%20Formula%20Calculation%20Options%20To%20Automatic.png"&gt;&lt;/img&gt;&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=2ac9434a-78ca-4861-9168-72fcfad55055"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=py5n7nb2QBI:odhpscOxwjs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=py5n7nb2QBI:odhpscOxwjs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=py5n7nb2QBI:odhpscOxwjs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>How To</category>
      <category>Random</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=3e83b49a-eb4c-4321-a94a-692ec913dc52</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,3e83b49a-eb4c-4321-a94a-692ec913dc52.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Format Dates &amp; Times in SSRS Report Builder</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,3e83b49a-eb4c-4321-a94a-692ec913dc52.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToFormatDatesTimesInSSRSReportBuilder.aspx</link>
      <pubDate>Tue, 29 Dec 2009 21:06:08 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I was recently using SQL Server Report Builder, and needed to format a date and time in&#xD;
a specific way.  I went to edit the related expression, and looked for built-in&#xD;
functions to help me work with dates under Common Functions &amp;gt; Date &amp;amp; Time ...&#xD;
where I found FormatDateTime:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" src="http://www.stuffthatjustworks.com/content/binary/Using%20FormatDateTime%20in%20SSRS%20Expression.png" alt="Using FormatDateTime in SSRS Expression"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This is the example shown for how to use it:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;=FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate)&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This is helpful, because the 2nd argument is obviously a DateFormat enumeration&#xD;
... but what are the other members besides ShortDate?  I searched (like you might&#xD;
have) and couldn't come up with anything.  The only thing I can assume, is that&#xD;
the DateFormat enumeration used in SSRS expressions is the same as &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.dateformat.aspx" title="DateFormat enumeration"&gt;the&#xD;
DateFormat enumeration in Visual Basic&lt;/a&gt;, which is:&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
GeneralDate &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
LongDate &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
ShortDate &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
LongTime &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
ShortTime&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;p&gt;&#xD;
None of these "canned" formats matched the way I wanted to format the date, so I kept&#xD;
looking and noticed some MSDN samples that used the &lt;font face="Courier New"&gt;Format&lt;/font&gt; method&#xD;
instead of the &lt;font face="Courier New"&gt;FormatDateTime&lt;/font&gt; method.  In the&#xD;
expression edittor, that function can be found under Common Functions &amp;gt; Text:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" src="http://www.stuffthatjustworks.com/content/binary/Format%20a%20date%20and%20time%20in%20SQL%20Report%20Builder%20Expressions.png" alt="Format a date and time in SQL Report Builder Expression"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The Format method is very flexible, and allows you to use any of the standard string-based&#xD;
format patterns you are probably already familar with.  Here are a few common&#xD;
examples:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;=Format(Fields!myDateTime.Value, "M/d/yy") ... 6/15/09&lt;br&gt;&#xD;
=Format(Fields!myDateTime.Value, "M/d/yyyy h:mmtt") ... 6/15/2009 2:45PM&lt;br&gt;&#xD;
=Format(Fields!myDateTime.Value, "MM/dd/yy HH:mm") ... 06/15/09 14:45&lt;br&gt;&#xD;
=Format(Fields!myDateTime.Value, "MMM d, yyyy") ... Jun 15, 2009&lt;br&gt;&lt;/font&gt;&#xD;
          &lt;font face="Courier New"&gt;=Format(Fields!myDateTime.Value, "Short Date") ...&#xD;
6/15/2009&lt;br&gt;&lt;font face="Courier New"&gt;=Format(Fields!myDateTime.Value, "Long Date") ... Monday,&#xD;
June 15, 2009&lt;/font&gt;&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Of course, the standard format strings like "Short Date" and "Long Date"  may&#xD;
vary depending on the culture set on your system.  The examples above reflect&#xD;
the "en-US" configuration.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Then, here is a slight variation of the 2nd sample.  It is my personal&#xD;
favorite and how I usually format all dates that have time values related to them,&#xD;
because I think the lowercase AM/PM designator makes the value easier for someone&#xD;
to scan, and requires less conscience effort to process.  If it is all uppercase,&#xD;
the AM/PM designator seems to blend in with the rest of the text and you have to pay&#xD;
a little closer attention to interpret the related value (even if it is just a tenth&#xD;
of a second).&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font face="Courier New"&gt;=LCase(Format(Fields!myDateTime.Value, "M/d/yy h:mmtt"))&#xD;
... 3/15/2009 2:45pm&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=3e83b49a-eb4c-4321-a94a-692ec913dc52"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=hhTycp2zNz0:QC53kpbEl9M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=hhTycp2zNz0:QC53kpbEl9M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=hhTycp2zNz0:QC53kpbEl9M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
    <item>
      <trackback:ping>http://www.stuffthatjustworks.com/Trackback.aspx?guid=36557de0-496f-4eb1-a4e9-5da04a33e764</trackback:ping>
      <pingback:server>http://www.stuffthatjustworks.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.stuffthatjustworks.com/PermaLink,guid,36557de0-496f-4eb1-a4e9-5da04a33e764.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      
      <title>How To: Link Report Item To Dataset in SSRS Report Builder</title>
      <guid isPermaLink="false">http://www.stuffthatjustworks.com/PermaLink,guid,36557de0-496f-4eb1-a4e9-5da04a33e764.aspx</guid>
      <link>http://www.StuffThatJustWorks.com/HowToLinkReportItemToDatasetInSSRSReportBuilder.aspx</link>
      <pubDate>Mon, 28 Dec 2009 17:36:38 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p style="MARGIN: 0in 0in 0pt" class="MsoNormal"&gt;&#xD;
          &lt;font color="#000000"&gt;I was working on a report in Report Builder 2.0 for SQL Server&#xD;
2008 Reporting Services, and added a textbox to an existing report.  I wanted&#xD;
to display some summary info related to the data shown in the report.  I added&#xD;
a textbox, then went to edit the “Expression” property of that report item, but&#xD;
wasn't able to select any fields because it said “Report item not linked to a dataset.”&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p style="MARGIN: 0in 0in 0pt" class="MsoNormal"&gt;&#xD;
          &lt;font color="#000000"&gt;&#xD;
          &lt;/font&gt; &#xD;
&lt;/p&gt;&#xD;
        &lt;p style="MARGIN: 0in 0in 0pt" class="MsoNormal"&gt;&#xD;
          &lt;img border="0" alt="Report Item not linked to a dataset" src="http://www.stuffthatjustworks.com/content/binary/Report Item not linked to a dataset.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p style="MARGIN: 0in 0in 0pt" class="MsoNormal"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So I tried to find a property on the textbox related to a "Dataset"&#xD;
(like the "DataSetName" property on Tablix elements), but the only thing I found&#xD;
was a “DataElementName” property … which I tried, but didn’t work.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img border="0" alt="SSRS Report Item Textbox and Tablix Report Builder Properties" src="http://www.stuffthatjustworks.com/content/binary/Report Item Textbox and Tablix Properties.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I then learned you can link to a dataset by defining it’s name directly in the expression,&#xD;
like this:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font size="3" face="Courier New"&gt;=Count(Fields!Address.Value,"DatasetName")&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.stuffthatjustworks.com/aggbug.ashx?id=36557de0-496f-4eb1-a4e9-5da04a33e764"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=5WSGaSOGMR8:PM3YGmT6hWo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/StuffThatJustWorks?a=5WSGaSOGMR8:PM3YGmT6hWo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StuffThatJustWorks?i=5WSGaSOGMR8:PM3YGmT6hWo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <category>Code</category>
      <category>How To</category>
    </item>
  </channel>
</rss>

