<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Bits &amp; Pieces</title>
  <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/" />
  <link rel="self" href="http://www.netfusionservices.com/DasBlog/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-08-02T20:19:22.4161073-07:00</updated>
  <author>
    <name>Net Fusion Corporation</name>
  </author>
  <subtitle>The Net Fusion Blog</subtitle>
  <id>http://www.netfusionservices.com/DasBlog/</id>
  <generator uri="http://www.dasblog.net" version="2.0.7180.0">DasBlog</generator>
  <entry>
    <title>Manage Terminal Services Sessions from a Command Prompt</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/08/03/ManageTerminalServicesSessionsFromACommandPrompt.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,9e7a9e9b-021d-42ac-b080-0f970c0712c9.aspx</id>
    <published>2008-08-02T20:19:22.4161073-07:00</published>
    <updated>2008-08-02T20:19:22.4161073-07:00</updated>
    <category term="Windows" label="Windows" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,Windows.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Tonight I had a few orphaned sessions to a remote machine that were not being enumerated
by Terminal Services Manager or a remote connection (from Computer Management). 
I almost gave up and drove to the physical machine, but I found this trick online
first.
</p>
        <p>
Here's a handy way to view and manage sessions from the command prompt.
</p>
        <p>
          <strong>To List All Sessions</strong>
        </p>
        <p>
Start-&gt;Run-&gt;cmd
</p>
        <p>
query session /server:xxx.xxx.xxx.xxx
</p>
        <p>
          <strong>To End a Session</strong>
        </p>
        <p>
Start-&gt;Run-&gt;cmd
</p>
        <p>
reset session 1 /server:xxx.xxx.xxx.xxx
</p>
        <p>
          <em>Note that "1" represents a session id.  You can see all available sessions
from the previous "query" command.  Insert the correct number to terminate it.</em>
        </p>
        <p>
Once you know these few commands, its actually quicker to manage remote sessions from
the command prompt.
</p>
        <p>
- Tim Medora
</p>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=9e7a9e9b-021d-42ac-b080-0f970c0712c9" />
      </div>
    </content>
  </entry>
  <entry>
    <title>MaxDB Access with ODBC</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/07/25/MaxDBAccessWithODBC.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,aec26f1c-ea02-42db-a10c-3b7fa331b898.aspx</id>
    <published>2008-07-25T13:19:54.7419954-07:00</published>
    <updated>2008-07-25T13:19:54.7419954-07:00</updated>
    <category term="C#" label="C#" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,C%23.aspx" />
    <category term="Database" label="Database" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,Database.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Little tip I thought I'd share...as of the date of this posting (7/2008), when building
connection strings to access a MaxDB instance, the password must be changed to all
uppercase.
</p>
        <p>
For anyone who's wondering, it is possible to connect to MaxDB with ASP.Net/C#. 
Use the System.Data.Odbc library and a DSN to connect with only a few lines of code.
</p>
        <p>
- Tim Medora
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=aec26f1c-ea02-42db-a10c-3b7fa331b898" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Ambiguous SQL Server 2005 Error - And One Solution</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/05/26/AmbiguousSQLServer2005ErrorAndOneSolution.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,aac87141-2e2e-4ec0-8fac-ed36b97d4095.aspx</id>
    <published>2008-05-26T14:50:51.297-07:00</published>
    <updated>2008-05-26T14:50:51.297625-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Today I was happily coding a .Net 3.5/SQL
Server 2005 web application when things came to a grinding halt with the error:<br /><br /><font color="#ff0000"><b>A severe error occurred on the current command.  The
results, if any, should be discarded.<br /><br /></b><font color="#000000">I googled the error (of course), but found a dozen different
answers and many of them required installing service packs or hotfixes.  While
I'm not opposed to that, I knew that it shouldn't be necessary.<br /><br />
I'm sure there are many causes for this error, but here was mine:<br /><br />
BEGIN TRANSACTION;<br /><br />
BEGIN TRY<br /><br />
    IF( @UserId &lt; 1 ) BEGIN<br /><br />
        IF( (SELECT count(UserId) FROM [User] WHERE
Email = @Email) &gt; 0) BEGIN<br /><font color="#ff0000">            SET
@Status = 1;<br />
            RETURN;</font><br />
        END<br /><br />
...<br /><br />
See the problem? I'm returning without committing or rolling back my transaction. 
While this is a stupid mistake on my part, the error message is quite ambiguous, but
thankfully the solution is simple.  Before returning, insert cleanup GOTO cleanup
such as:<br /><br /></font></font><font color="#ff0000"><font color="#000000">BEGIN TRANSACTION;<br /><br />
BEGIN TRY<br /><br />
    IF( @UserId &lt; 1 ) BEGIN<br /><br />
        IF( (SELECT count(UserId) FROM [User] WHERE
Email = @Email) &gt; 0) BEGIN<br /><font color="#ff0000">            <font color="#000000">SET
@Status = 1;</font><br />
            GOTO NoSuccessReturn;</font><br />
        END<br /><br />
...</font></font><br /><font color="#ff0000"><font color="#000000"><br /><font color="#ff0000">NoSuccessReturn:<br />
    IF( @@TRANCOUNT &gt; 0 )BEGIN    
<br />
        ROLLBACK TRANSACTION;<br />
    END<br /><br />
    RETURN;</font><br /><br />
Hope this helps someone!<br /><br />
--Tim Medora<br /><br /><br /></font></font><p></p><img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=aac87141-2e2e-4ec0-8fac-ed36b97d4095" /></div>
    </content>
  </entry>
  <entry>
    <title>Disabling Inheritance in Web.Config Files</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/05/06/DisablingInheritanceInWebConfigFiles.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,268d0d09-719b-4dad-b465-63b44fb4afbe.aspx</id>
    <published>2008-05-05T19:38:57.795-07:00</published>
    <updated>2008-05-05T19:39:15.7492345-07:00</updated>
    <category term="ASP.Net" label="ASP.Net" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,ASP.Net.aspx" />
    <category term="C#" label="C#" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,C%23.aspx" />
    <category term="Visual Studio" label="Visual Studio" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,Visual%2BStudio.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Most ASP.Net developers quickly learn that web.config file settings percolate from
the top down.  This is commonly used to provide global configuration for a single
web application, but it's pretty easy to forget that web.config settings can be inherited
across different virtual directories.
</p>
        <p>
For example:
</p>
        <p>
1) Create a website in IIS.<br />
2) Create a virtual directory for a second site underneath the IIS website.<br />
3) Reference a type in the web.config for site #1, such as in a HttpHandler
block.<br />
4) Unless the second site has the type referenced in #3 (or it is in the GAC), second
site will now immediately throw an exception, "Cannot load type xxx.xxx.xxx".
</p>
        <font color="#0000ff" size="2">
          <p>
            <font color="#000000">
              <strong>In web.config #1</strong>
            </font>
            <br />
&lt;
</p>
        </font>
        <font color="#800000" size="2">httpHandlers</font>
        <font color="#0000ff" size="2">&gt;<br /></font>
        <font color="#0000ff" size="2">   &lt;</font>
        <font color="#800000" size="2">add</font>
        <font color="#0000ff" size="2">
        </font>
        <font color="#ff0000" size="2">verb</font>
        <font color="#0000ff" size="2">=</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">GET</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">
        </font>
        <font color="#ff0000" size="2">path</font>
        <font color="#0000ff" size="2">=</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">*.css.ashx</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">
        </font>
        <font color="#ff0000" size="2">type</font>
        <font color="#0000ff" size="2">=</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">NFC.PublicWeb.UILogic.PathResolver,NFC.PublicWeb</font>
        <font color="#000000" size="2">"</font>
        <font color="#0000ff" size="2">/&gt;<br /></font>
        <font color="#0000ff" size="2">&lt;/</font>
        <font color="#800000" size="2">httpHandlers</font>
        <font color="#0000ff" size="2">&gt;</font>
        <p>
          <font color="#0000ff" size="2">
            <font color="#000000">This issue is caused because
every virtual directory underneath the top-level website is inheriting settings from
the top-most web.config.  Many of these inherited settings would go unnoticed,
but as soon as the child virtual directory hits something it can't handle, it immediately
throws a show-stopping (as all config errors are) exception.</font>
          </font>
        </p>
        <p>
          <font color="#0000ff" size="2">
            <font color="#000000">
              <strong>Quick Solution?<br /></strong>
            </font>
          </font>Wrap application specific blocks of code in the LOCATION tag. 
Obviously this must be used judiciously, but it's a useful fix to a sneaky problem.
</p>
        <font color="#0000ff" size="2">
          <font color="#0000ff" size="2">
            <p>
              <strong>&lt;</strong>
            </p>
          </font>
          <strong>
            <font color="#800000" size="2">location</font>
            <font color="#0000ff" size="2">
            </font>
            <font color="#ff0000" size="2">path</font>
            <font color="#0000ff" size="2">=</font>
            <font color="#000000" size="2">"</font>
            <font color="#0000ff" size="2">.</font>
            <font color="#000000" size="2">"</font>
            <font color="#0000ff" size="2">
            </font>
            <font color="#ff0000" size="2">inheritInChildApplications</font>
            <font color="#0000ff" size="2">=</font>
            <font color="#000000" size="2">"</font>
            <font color="#0000ff" size="2">false</font>
            <font color="#000000" size="2">"</font>
          </strong>
          <font color="#0000ff" size="2">
            <strong>&gt;</strong>
            <br />
   &lt;</font>
          <font color="#800000" size="2">system.web</font>
          <font color="#0000ff" size="2">&gt;<br />
      &lt;<font color="#800000" size="2">httpHandlers</font><font color="#0000ff" size="2">&gt;<br /></font><font color="#0000ff" size="2">         &lt;</font><font color="#800000" size="2">add</font><font color="#0000ff" size="2"></font><font color="#ff0000" size="2">verb</font><font color="#0000ff" size="2">=</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2">GET</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2"></font><font color="#ff0000" size="2">path</font><font color="#0000ff" size="2">=</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2">*.css.ashx</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2"></font><font color="#ff0000" size="2">type</font><font color="#0000ff" size="2">=</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2">NFC.PublicWeb.UILogic.PathResolver,NFC.PublicWeb</font><font color="#000000" size="2">"</font><font color="#0000ff" size="2">/&gt;<br /></font><font color="#0000ff" size="2">      &lt;/</font><font color="#800000" size="2">httpHandlers</font><font color="#0000ff" size="2">&gt;<br />
   &lt;/<font color="#800000">system.web</font><font color="#0000ff" size="2">&gt;<br /><strong>&lt;/</strong><font color="#800000" size="2"><strong>location<font color="#0000ff">&gt;</font></strong><br /></font></font></font></font>
          <p>
            <font color="#0000ff" size="2">
              <font color="#0000ff" size="2">
                <font color="#0000ff" size="2">
                  <font color="#800000" size="2">
                    <font color="#000000">For
a detailed discussion of this topic, see</font>
                    <a href="http://www.aspdotnetfaq.com/Faq/how-to-disable-web-config-inheritance-for-child-applications-in-subfolders-in-asp-net.aspx" target="_blank">this
useful article on www.aspdotnetfaq.com</a>.
</font>
                </font>
              </font>
            </font>
          </p>
        </font>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=268d0d09-719b-4dad-b465-63b44fb4afbe" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Determining if an Object's Data is Dirty</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/05/02/DeterminingIfAnObjectsDataIsDirty.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,e3441641-39f4-4912-8047-fb7bae804309.aspx</id>
    <published>2008-05-02T16:13:36.405-07:00</published>
    <updated>2008-05-05T14:57:50.2089145-07:00</updated>
    <category term="C#" label="C#" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,C%23.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Check out this brief whitepaper by Chris Szabo on a more elegant way of determining
if the data encapsulated by an object is dirty or not.
</p>
        <p>
Typical practice is to always save the object, dirty or not, which can be wasteful
in a high-traffic scenario.  Alternatively, many developers maintain an IsDirty
flag, which does the job, but isn't that elegant.  It also doesn't account for
data that has "changed" but might actually be the same, such as when a user enters
a value into a field that is bound to an object, and then undoes the operation.
</p>
        <p>
          <a href="http://www.netfusioncorporation.com/Downloads/2008/Intelligent%20Data%20Persistence.pdf">http://www.netfusioncorporation.com/Downloads/2008/Intelligent%20Data%20Persistence.pdf</a>
        </p>
        <p>
- Tim Medora
</p>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=e3441641-39f4-4912-8047-fb7bae804309" />
      </div>
    </content>
  </entry>
  <entry>
    <title>A Year of Vista</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/04/18/AYearOfVista.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,15385784-98af-46f1-a63b-0f5ce15b0d97.aspx</id>
    <published>2008-04-18T11:44:26.36-07:00</published>
    <updated>2008-04-18T11:46:11.332819-07:00</updated>
    <category term="Windows Vista" label="Windows Vista" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,Windows%2BVista.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Actually, it's been more than a year... alot more.  But a year ago Processor
Magazine interviewed me for my opinion on Windows Vista.
</p>
        <p>
          <a href="http://www.processor.com/editorial/article.asp?article=articles%2Fp2915%2F20p15%2F20p15.asp" target="_blank">http://www.processor.com/editorial/article.asp?article=articles%2Fp2915%2F20p15%2F20p15.asp</a>
        </p>
        <p>
I'm sure everyone is dying to see what I had to say.
</p>
        <p>
A year later, I'm pretty much of the same opinion... I've survived and haven't had
any major problems.  Throw a powerful computer at it, and it isn't half bad.
</p>
        <p>
- Tim Medora
</p>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=15385784-98af-46f1-a63b-0f5ce15b0d97" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Visual Studio 2008</title>
    <link rel="alternate" type="text/html" href="http://www.netfusionservices.com/DasBlog/2008/04/16/VisualStudio2008.aspx" />
    <id>http://www.netfusionservices.com/DasBlog/PermaLink,guid,e93bfddd-63de-463c-93ed-d58bedae5a12.aspx</id>
    <published>2008-04-15T23:07:42.054-07:00</published>
    <updated>2008-05-05T13:46:26.4468385-07:00</updated>
    <category term="Visual Studio" label="Visual Studio" scheme="http://www.netfusionservices.com/DasBlog/CategoryView,category,Visual%2BStudio.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Visual Studio 2008 has been good to me so far.
</p>
        <p>
I'm running:
</p>
        <p>
- VS2008 Team System Developer Edition<br />
- Windows Vista Enterprise 
<br />
- Mac Pro dual duo-core Xeon 64-bit, 2GB RAM, 10K SATA HD, ATI Radeon x1900
</p>
        <p>
          <br />
If anyone is considering upgrading, here's my two cents:
</p>
        <p>
PROS
</p>
        <p>
- clean as ever, as fast or faster than previous versions<br />
- new project template types<br />
- painless to switch between different versions of the .Net framework<br />
- supports cool new stuff like Linq &amp; Silverlight<br />
- seems very stable; I've used it heavily for about 2 1/2 months now.<br />
- drawing issues that plagued Vista combined with VS 2005 seem to be gone.<br />
- plays nicely with VS 2005 on the same machine.
</p>
        <p>
CONS
</p>
        <p>
- can't open a 2003/2005 project without converting it... this can be a deal breaker
unless you are the only one on a project, or the whole team has upgraded.  Make
sure not to upgrade a project and check it back into source control unless you are
the owner of that code and everyone else using that project knows about it.<br />
- I have seen one error dialog popup repeatedly: "Cannot connect to undo manager". 
I haven't see any negative side effects of this error, other than it is annoying to
get the dialog (possibly once or twice during several hours of usage).
</p>
        <p>
Recommendation... if you get the chance to install it, go for it.  You can always
continue to use VS 2005 for day to day work and try out some of the new features of
the 3.5 framework.
</p>
        <p>
- Tim Medora
</p>
        <img width="0" height="0" src="http://www.netfusionservices.com/DasBlog/aggbug.ashx?id=e93bfddd-63de-463c-93ed-d58bedae5a12" />
      </div>
    </content>
  </entry>
</feed>