<?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>Scott Klueppel's Blog</title>
  <link rel="alternate" type="text/html" href="http://offroadcoder.com/" />
  <link rel="self" href="http://offroadcoder.com/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2010-07-26T23:35:38.5764186-04:00</updated>
  <author>
    <name>Scott Klueppel</name>
  </author>
  <subtitle>making the hard line look easy</subtitle>
  <id>http://offroadcoder.com/</id>
  <generator uri="http://dasblog.info/" version="2.1.8102.813">DasBlog</generator>
  <entry>
    <title>My data access story before Enterprise Library 5</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/07/27/MyDataAccessStoryBeforeEnterpriseLibrary5.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,fb59ebf8-4230-43f8-9226-b02389165fc1.aspx</id>
    <published>2010-07-26T23:32:07.8393462-04:00</published>
    <updated>2010-07-26T23:35:38.5764186-04:00</updated>
    <category term="C#" label="C#" scheme="http://offroadcoder.com/CategoryView,category,C.aspx" />
    <category term="Database" label="Database" scheme="http://offroadcoder.com/CategoryView,category,Database.aspx" />
    <category term="Enterprise Library" label="Enterprise Library" scheme="http://offroadcoder.com/CategoryView,category,EnterpriseLibrary.aspx" />
    <category term="Extensions" label="Extensions" scheme="http://offroadcoder.com/CategoryView,category,Extensions.aspx" />
    <category term="SQL" label="SQL" scheme="http://offroadcoder.com/CategoryView,category,SQL.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
In .NET 1.1, I tried the original MS Data Access Application Block’s SqlHelper (you
can still download it <a href="http://download.microsoft.com/download/VisualStudioNET/daabref/RTM/NT5/EN-US/DataAccessApplicationBlock.msi">here</a>).
It was great for most of the common uses, but was lacking in some areas. The consuming
code looked sloppy and encouraged blind faith that database objects never changed.
It also didn’t support transactions as I would have liked, and didn’t support my obsession
with custom entities. I started out writing an extension library that wrapped SqlHelper,
but that felt very wrong… wrapping the ADO.NET wrapper (SqlHelper). I ended up writing
my own version of SqlHelper called SqlHelper (nice name, eh?). You see, at this time
I was getting over a bad relationship with a series of ORM products that had a negative
effect on my productivity. I decided to revolt with good ol’ fashion data access methods
that have never let us down.
</p>
        <p>
The only thing worse than my ORM experience was the disgusting over-use of DataSet
and DataTable. For my dollar, DataReader is where it’s at. I agree that using the
reader is slightly more dangerous in the hands of an inexperienced or inattentive
developer (did you know you have to close the reader when you’re done with it??).
Nothing can compare with the speed and flexibility of the reader, which is why DataSet
and DataAdapter use it at their core. If you are working with custom entities, instead
of DataSets and DataTables, you would be crazy to not use the DataReader.
</p>
        <p>
My SqlHelper worked in conjunction with my DataAccessLayer class that defined a few
delegates that made reader-to-object-mapping a simple task.  Once the mapping
methods were written to be used with the delegates, which returned object or System.Collections.CollectionBase
because we did not yet have generics (can you imagine??), you simply called the SqlHelper
to do all of the hard work. SqlHelper did not implement all of the craziness that
the original version contained. It was a short 450 lines of code that did nothing
but access data in a safe and reliable way. In the example below, we have the GenerateDocumentFromReader
method that is used by the GenerateObjectFromReader delegate. When SqlHelper.ExecuteReaderCmd
is called, the delegate is passed in to map the reader results to my object… in this
case a Document.
</p>
        <pre class="brush: c#;">// Object generation method 
private static object GenerateDocumentFromReader(IDataReader returnData) 
{
     Document document = new Document();
     if (returnData.Read())
     {
         document = new Document(
             (int)returnData["DocumentId"],
             (byte[])returnData["DocumentBinary"],
             returnData["FileName"].ToString(),
             returnData["Description"].ToString(),
             returnData["ContentType"].ToString(),
             (int)returnData["FileSize"],
             returnData["MD5Sum"].ToString(),
             (bool) returnData["EnabledInd"],
             (int)returnData["CreatorEmpId"],
             Convert.ToDateTime(returnData["CreateDt"]),
             (int)returnData["LastUpdateEmpId"],
             Convert.ToDateTime(returnData["LastUpdateDt"]));
     }     return document;
} 
public static Document GetDocumentByDocumentId(int documentId)
{
     SqlCommand sqlCmd = new SqlCommand();
     SqlHelper.SetCommandArguments(sqlCmd, CommandType.StoredProcedure, "usp_Document_GetDocumentByDocumentId");
     SqlHelper.AddParameterToSqlCommand(sqlCmd, "@DocumentId", SqlDbType.Int, 0, ParameterDirection.Input, documentId);
     DataAccessLayer.GenerateObjectFromReader gofr = new DataAccessLayer.GenerateObjectFromReader(GenerateDocumentFromReader);
     Document document = SqlHelper.ExecuteReaderCmd(sqlCmd, gofr) as Document;
     return document;
}
</pre>
        <p>
This worked wonderfully for years. After converting, I couldn’t imagine a project
that used ORM, DataSets, or DataTables again. I’ve been on many 1.1 projects since
writing my SqlHelper in 2004, and I have successfully converted them all. In early
2006, MS graced us with .NET 2.0. Generics, System.Transactions, and partial classes
changed my life. In my first few exposures to generics, like Vinay “the Generic Guy”
Ahuja’s 2005 Jax Code Camp presentation and Juval “My Hero” Lowy’s <a href="http://msdn.microsoft.com/en-us/library/ms379564">MSDN
article “An Introduction to Generics”</a>, I listened/read and pondered the millions
of uses of generics. I adapted my SqlHelper heavily to use these new technologies
and morphed it into something else that closely represented the newest version of
the DAAB, Enterprise Library 3.
</p>
        <p>
By this point, I wanted to convert to Enterprise Library. It was far better than the
simple SqlHelper. It had better transaction support, though I don’t know if that included
System.Transactions. I could have put my object generation extensions on top of it
and it would have worked well for years. On home projects I had already converted
to use EntLib. At work I was not so lucky. The deep stack trace when something went
wrong scared everyone, and that is still a fear for those starting out in EntLib today.
To ease the fears, I just created my replacement to SqlHelper… the Database class. 
</p>
        <p>
I used a lot of the same naming conventions as Enterprise Library. In fact, much of
the consuming code was nearly identical (except for the fact that it did not implement
the provider pattern and worked only with SQL Server). This was in anticipation of
a quick adoption of Enterprise Library 3 in the workplace. Kind of a “see… not so
bad” move on my part. Just like EntLib, you created a Database class using the DatabaseFactory
that used your default connection string key. Commands and parameters were created
and added with methods off of the Database class. Aside from the SqlCommand/DbCommand,
everything looked and felt the same, but came in a small file with only 490 lines
of code instead of 5 or more projects with 490 files. Using it felt the same, too.
Only my object/collection generation extensions looked different from the standard
reader, scalar, dataset routines. Below is the same code from above using the Database
class and related classes to create a Document from a reader.
</p>
        <pre class="brush: c#;">// Object generation method
private static Document GenerateDocumentFromReader(IDataReader returnData)
{
     Document document = new Document();
     if (returnData.Read())
     {
         document = new Document(
             GetIntFromReader(returnData, "DocumentId"),
             GetIntFromReader(returnData, "DocumentTypeId"),
             GetStringFromReader(returnData, "DocumentTypeName"),
             GetByteArrayFromReader(returnData, "DocumentBinary"),
             GetStringFromReader(returnData, "FileName"),
             GetStringFromReader(returnData, "Description"),
             GetStringFromReader(returnData, "ContentType"),
             GetIntFromReader(returnData, "FileSize"),
             GetStringFromReader(returnData, "MD5Sum"),
             GetStringFromReader(returnData, "CreatorEmpID"),
             GetDateTimeFromReader(returnData, "CreateDt"),
             GetStringFromReader(returnData, "LastUpdateEmpID"),
             GetDateTimeFromReader(returnData, "LastUpdateDt"));
     }
     return document;
} 
public static Document GetDocumentByDocumentId(int documentId)
{
     Database db = DatabaseFactory.CreateDatabase(AppSettings.ConnectionStringKey);
     SqlCommand sqlCmd = db.GetStoredProcCommand("usp_Document_GetDocumentByDocumentId");
     db.AddInParameter(sqlCmd, "DocumentId", SqlDbType.Int, documentId);
     GenerateObjectFromReader&lt;Document&gt; gofr = new GenerateObjectFromReader&lt;Document&gt;(GenerateDocumentFromReader);
     Document document = CreateObjectFromDatabase&lt;Document&gt;(db, sqlCmd, gofr);
     return document;
}
</pre>
        <p>
This, too, worked great for years. Other than a brief period in 2007 when I tried
to wrap all of my data access code with WCF services, .NET 3.0 came and went with
no changes to my data access methodology. In late 2007, I had lost all love of my
SqlHelper and my Database/DataAccessLayer classes. With .NET 3.5 and Enterprise Library
4.0, I no longer felt the need to roll my own. .NET now had extension methods for
me to extend Enterprise Library however I pleased. Enterprise Library supported System.Transactions
making its use a dream if behind a WCF service that allowed transaction flow. With
a succinct 190 lines of extension code, I had it made in the shade with Enterprise
Library 4.0. In fact, I haven’t used anything since.
</p>
        <p>
The consuming code was almost exactly the same. You’ll notice the SqlCommand has changed
to DbCommand. The SqlDbType has changed to DbType. Other than that, it feels and works
the same. 
</p>
        <pre class="brush: c#;">// Object generation method
private static Document GenerateDocumentFromReader(IDataReader returnData)
{
     Document document = new Document();
     if (returnData.Read())
     {
         document = new Document(
             returnData.GetInt32("DocumentId"),
             returnData.GetInt32("DocumentTypeId"),
             returnData.GetString("DocumentTypeName"),
             returnData.GetByteArray("DocumentBinary"),
             returnData.GetString("FileName"),
             returnData.GetString("Description"),
             returnData.GetString("ContentType"),
             returnData.GetInt32("FileSize"),
             returnData.GetString("MD5Sum"),
             returnData.GetString("CreatorEmpID"),
             returnData.GetDateTime("CreateDt"),
             returnData.GetString("LastUpdateEmpID"),
             returnData.GetDateTime("LastUpdateDt"));
     }
     return document;
}
public static Document GetDocumentByDocumentID(int documentId)
{
     Database db = DatabaseFactory.CreateDatabase();
     DbCommand cmd = db.GetStoredProcCommand("usp_Document_GetDocumentByDocumentId");
     db.AddInParameter(cmd, "DocumentID", DbType.Int32, documentId);
     GenerateObjectFromReader&lt;Document&gt; gofr = new GenerateObjectFromReader&lt;Document&gt;(GenerateDocumentFromReader);
     Document document = db.CreateObject&lt;Document&gt;(cmd, gofr);
     return document;
}
</pre>
        <p>
With a full suite of unit test projects available for download with the Enterprise
Library source files, the fear should be abated for the remaining holdouts. Getting
started is as easy as including two DLL references, and adding 5 lines of config.
You can’t beat that!
</p>
        <p>
I downloaded Enterprise Library 5 last week. I’ve been making use of new features
such as result set mapping (eliminating the need for my object generation extensions),
parameter mapping, and accessors that bring them all together. There’s a bunch of
inversion of control features in place as well. I think I’ll be quite comfortable
in my new EntLib5 home.
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=fb59ebf8-4230-43f8-9226-b02389165fc1" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Binding to the forest root failed.</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/06/16/BindingToTheForestRootFailed.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,7e8161ef-7174-4361-9ce0-a85ce3741ae7.aspx</id>
    <published>2010-06-15T21:40:52.8866987-04:00</published>
    <updated>2010-06-15T21:40:52.8866987-04:00</updated>
    <category term="Infrastructure" label="Infrastructure" scheme="http://offroadcoder.com/CategoryView,category,Infrastructure.aspx" />
    <category term="Queuing" label="Queuing" scheme="http://offroadcoder.com/CategoryView,category,Queuing.aspx" />
    <category term="WCF" label="WCF" scheme="http://offroadcoder.com/CategoryView,category,WCF.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
For the few MSMQ or NetMsmqBinding WCF users I’ve encountered, here is an error you
may encounter in a highly secured environment. 
</p>
        <blockquote>
          <p>
            <font face="Consolas" size="2">0xC00E008F Binding to the forest root failed. This
error usually indicates a problem in the DNS configuration. MQ_ERROR_DS_BIND_ROOT_FOREST</font>
          </p>
        </blockquote>
        <p>
This is most likely another firewall problem. If port 3268 is not open, MSMQ cannot
register or authenticate with the user’s certificate in AD. Here is the port description:
</p>
        <p>
          <strong>3268/TCP,UDP msft-gc,</strong> Microsoft Global Catalog (LDAP service which
contains data from Active Directory forests) 
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=7e8161ef-7174-4361-9ce0-a85ce3741ae7" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Starting a new job</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/06/16/StartingANewJob.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,9ad89a0e-1cde-483a-b6b5-be1f4900c9cb.aspx</id>
    <published>2010-06-15T20:46:14.8286792-04:00</published>
    <updated>2010-06-24T06:20:30.3610957-04:00</updated>
    <category term="Quotes" label="Quotes" scheme="http://offroadcoder.com/CategoryView,category,Quotes.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <table border="0" cellspacing="0" cellpadding="2" width="400">
          <tbody>
            <tr>
              <td valign="top" colspan="2">
“We cannot become what we need to be by remaining what we are”</td>
            </tr>
            <tr>
              <td valign="top">
 </td>
              <td valign="top" align="right">
-- Max Depree</td>
            </tr>
          </tbody>
        </table>
        <p>
 
</p>
        <p>
Max Depree... I think I need a Herman Miller chair for the home office.
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=9ad89a0e-1cde-483a-b6b5-be1f4900c9cb" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The IDesign Method</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/05/14/TheIDesignMethod.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,93c1acd6-78dc-4ca2-8815-f46281c5246f.aspx</id>
    <published>2010-05-14T17:42:19.6821077-04:00</published>
    <updated>2010-05-14T17:42:19.6821077-04:00</updated>
    <category term="Quotes" label="Quotes" scheme="http://offroadcoder.com/CategoryView,category,Quotes.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
As I sit through the last few hours of Juval Lowy’s Architects Master Class, drinking
my Honest Tea, I see a great quote on the inside of the bottle. How appropriate.
</p>
        <p>
“The greatest difficulty in the world is not for people to accept new ideas, but to
make them forget about old ideas.”
</p>
        <p>
-- John Maynard Keynes
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=93c1acd6-78dc-4ca2-8815-f46281c5246f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The remote server or share does not support transacted file operations</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/05/08/TheRemoteServerOrShareDoesNotSupportTransactedFileOperations.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,88ec2d3e-12d8-4fa0-b1d4-e82f7d6c677e.aspx</id>
    <published>2010-05-08T11:32:25.661014-04:00</published>
    <updated>2010-05-08T11:33:22.692629-04:00</updated>
    <category term=".NET Framework" label=".NET Framework" scheme="http://offroadcoder.com/CategoryView,category,NETFramework.aspx" />
    <category term="C#" label="C#" scheme="http://offroadcoder.com/CategoryView,category,C.aspx" />
    <category term="MSDTC" label="MSDTC" scheme="http://offroadcoder.com/CategoryView,category,MSDTC.aspx" />
    <category term="Transactions" label="Transactions" scheme="http://offroadcoder.com/CategoryView,category,Transactions.aspx" />
    <category term="WCF" label="WCF" scheme="http://offroadcoder.com/CategoryView,category,WCF.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Despite its pitiful adoption in the developer community, I am implementing Transactional
NTFS (TxF) transactions using the Microsoft.KtmIntegration.TransactedFile class. This
allows me to reap the benefits of TransactionScope and distributed transactions for
file operations (e.g. creates, updates, deletes). This is the only missing piece for
typical transactional business applications. With the “KTM” and “KtmRm for Distributed
Transactions” services, available only on Vista, Windows 7, and Windows Server 2008,
file operations will roll back if the TransactionScope is not completed. 
</p>
        <p>
There’s just one problem… Transactional NTFS does not work with file shares. I can’t
remember the last time I put a “C:\FileStore” reference in a config file. A friendly
share like “\\server\FileStore” is always preferred, especially since DFS came about.
Attempting to use a share results in the following error message: 
</p>
        <blockquote>
          <p>
            <font color="#000080" size="2" face="Consolas">The remote server or share does not
support transacted file operations</font>
          </p>
        </blockquote>
        <p>
Don’t read this as “your remote server” or “your remote share”, but rather “all remote
servers and shares”. As mentioned in <a href="      http://msdn.microsoft.com/en-us/library/aa365738(v=VS.85).aspx" target="_blank">this
MSDN article</a>, TxF is not supported by the CIFS/SMB protocols. The error was probably
written with the expectation that one day some remote servers and shares would support
TxF. I emailed Microsoft about it and received a response fairly quickly. The response
was simply: 
</p>
        <blockquote>
          <p>
“We understand the need and have plans to eventually support TxF over SMB2, but we’re
not there yet and are not ready to announce if or when this will be supported. When
it is the documentation will be updated.”
</p>
        </blockquote>
        <p>
I’m not getting my hopes up, but Windows Server 2011 looks to be our only hope before
.NET changes beyond recognition and TxF is a distant memory. Until then, I wrapped
up all of my TxF code in a WCF service and install that service on the server with
the <em>FileStore</em> folder. 
</p>
        <p>
MSDN article – When to Use Transactional NTFS 
</p>
        <p>
      <a href="http://msdn.microsoft.com/en-us/library/aa365738(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa365738(v=VS.85).aspx</a></p>
        <p>
TxF Sandbox – Sample Projects (including Microsoft.KtmIntegration.TransactedFile) 
</p>
        <p>
      <a href="http://offroadcoder.com/content/binary/TxFSandbox.zip">TxFSandbox.zip</a></p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=88ec2d3e-12d8-4fa0-b1d4-e82f7d6c677e" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Gearing up for Juval Lowy’s Architect’s Master Class</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/04/22/GearingUpForJuvalLowysArchitectsMasterClass.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,d2a49ef9-af36-4689-965a-2989e57a7a17.aspx</id>
    <published>2010-04-21T20:56:04.4135205-04:00</published>
    <updated>2010-04-21T20:56:04.4135205-04:00</updated>
    <category term=".NET Framework" label=".NET Framework" scheme="http://offroadcoder.com/CategoryView,category,NETFramework.aspx" />
    <category term="Azure" label="Azure" scheme="http://offroadcoder.com/CategoryView,category,Azure.aspx" />
    <category term="C#" label="C#" scheme="http://offroadcoder.com/CategoryView,category,C.aspx" />
    <category term="Cloud" label="Cloud" scheme="http://offroadcoder.com/CategoryView,category,Cloud.aspx" />
    <category term="WCF" label="WCF" scheme="http://offroadcoder.com/CategoryView,category,WCF.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
The sole 2010 offering in the USA of <a href="http://idesign.net/" target="_blank">IDesign</a>’s
Architect’s Master Class conducted by the man himself, Juval Lowy, is only a few weeks
away. I checked in at the <a href="http://idesign.net/" target="_blank">IDesign web
site</a>, and found some updates the world needs to see.
</p>
        <ul>
          <li>
            <a href="http://idesign.net/idesign/download/IDesign%20CSharp%20Coding%20Standard.zip" target="_blank">The
IDesign C# Coding Standard</a> – updated for .NET 4.0</li>
          <li>
            <a href="http://idesign.net/idesign/download/IDesign%20WCF%20Coding%20Standard.zip" target="_blank">The
IDesign WCF Coding Standard</a> – updated for .NET 4.0</li>
          <li>
            <a href="http://idesign.net/idesign/DesktopDefault.aspx?tabindex=5&amp;tabid=11" target="_blank">The
IDesign Code Library</a> - updated for .NET 4.0, including Azure AppFabric Service
Bus extensions and the Service Bus Explorer (priceless)</li>
        </ul>
        <p>
If you want to learn something new every day, start at the top of the IDesign Code
Library and step through one example each day. Be careful, you might need to re-write
every line of code you’ve ever written.
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=d2a49ef9-af36-4689-965a-2989e57a7a17" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Balsamiq Mockups for Desktop</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/04/06/BalsamiqMockupsForDesktop.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,bae3db7f-fffb-4004-a249-c9867f72eaa8.aspx</id>
    <published>2010-04-05T22:42:08.734-04:00</published>
    <updated>2010-04-05T22:42:08.734-04:00</updated>
    <category term="Dev Tools" label="Dev Tools" scheme="http://offroadcoder.com/CategoryView,category,DevTools.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve been using the full desktop version for only a few days, but already love this
tool! In just a matter of minutes, I am able to draw a mockup for a screen and start
getting feedback. Here is a sample, a CodePlex-like UI, that took less than five minutes.
</p>
        <p>
 <a href="http://offroadcoder.com/content/binary/BalsamiqMockupsforDesktop_13F31/CodePlex.png"><img title="CodePlex" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="540" alt="CodePlex" src="http://offroadcoder.com/content/binary/BalsamiqMockupsforDesktop_13F31/CodePlex_thumb.png" width="740" border="0" /></a></p>
        <p>
Creating this mockup goes as follows:
</p>
        <ol>
          <li>
Drag a browser element onto the design surface, stretch it and type a URL and title 
</li>
          <li>
Using the “Quick Add” box, type “tab” &lt;Enter&gt; to add the tab control. Type “Home,
Downloads, Documentation, Discussions, etc.” and &lt;Enter&gt; again. Reposition the
tab element. 
</li>
          <li>
Using the “Quick Add” box, type “link” &lt;Enter&gt; twice to create a link bar for
the top right and another link bar to be positioned below the tabs. 
</li>
          <li>
Continue using the “Quick Add” box to add textboxes, label text, search boxes, images,
subtitle text, links, and data grids. Type values and reposition.</li>
        </ol>
        <p>
This tool has a few features I find to be more compelling than the imitators:
</p>
        <ol>
          <li>
            <strong>Speed</strong> – Being able to create and recreate mockups with such speed
and usefulness really promotes a good prototyping/review process. 
</li>
          <li>
            <strong>Look and Feel</strong> – Having an obvious “rough draft” look and feel gets
your customer thinking about usability and element placement and less about colors,
styles, images, copy, fonts, etc. This makes for a very productive meeting involving
customers in “the task at hand” and nothing more. 
</li>
          <li>
            <strong>Demo mode</strong> – Similar to MS SketchFlow, you can assign links to buttons
that can simulate events. When entering full-screen demo mode, you can click on these
links and move between your mockups as if it were a live site. It also has a large
pointer (arrow) and always points to the center, staying out of the way. 
</li>
          <li>
            <strong>Good user community</strong> – tons of free extensions like wizards, toolbars,
reporting chart elements, and plenty of iPhone/iPad junk for “those people”. I’m a
PC. 
</li>
          <li>
            <strong>Updates and Upgrades</strong> – weekly updates based on user feedback and
perpetual free upgrades. My emails have been answered within 12 hours, which is quite
impressive considering the 6+ hour time difference.</li>
        </ol>
        <p>
This is free to try on the web, but you cannot save or export the images. You can,
however, export the PNG with a watermark. Desktop version gives you some nice added
features like copy/paste, undo, and demo mode. 
</p>
        <p>
          <font size="2">
            <em>
              <strong>Try it out, buy it, and love it!</strong>
            </em>
          </font>
        </p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=bae3db7f-fffb-4004-a249-c9867f72eaa8" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Balsamiq Mockups</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/04/02/BalsamiqMockups.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,d510b5cf-bf4e-4671-aa48-9fd3263b40ef.aspx</id>
    <published>2010-04-01T20:28:57.609-04:00</published>
    <updated>2010-04-01T20:28:57.609-04:00</updated>
    <category term="Dev Tools" label="Dev Tools" scheme="http://offroadcoder.com/CategoryView,category,DevTools.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Check out <a href="http://www.balsamiq.com" target="_blank">http://www.balsamiq.com</a> to
see one of the best mockup tools ever created. I just started using it and it has
already paid off. I have made several mock-ups in minutes that cut my development
time in half. Having the ability to demo a new UI to users and change it during the
conversation is priceless.
</p>
        <p>
More to come… samples too!
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=d510b5cf-bf4e-4671-aa48-9fd3263b40ef" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The flowed transaction could not be unmarshaled - Untrusted Domains update</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/03/16/TheFlowedTransactionCouldNotBeUnmarshaledUntrustedDomainsUpdate.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,2d946739-b527-41a7-8422-d29f4149e47a.aspx</id>
    <published>2010-03-15T22:54:48.443-04:00</published>
    <updated>2010-03-16T08:39:45.490375-04:00</updated>
    <category term="SQL" label="SQL" scheme="http://offroadcoder.com/CategoryView,category,SQL.aspx" />
    <category term="Transactions" label="Transactions" scheme="http://offroadcoder.com/CategoryView,category,Transactions.aspx" />
    <category term="WCF" label="WCF" scheme="http://offroadcoder.com/CategoryView,category,WCF.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
In a <a href="http://offroadcoder.com/2009/01/29/TheFlowedTransactionCouldNotBeUnmarshaled.aspx" target="_blank">previous
post</a>, I discussed solutions to the dreaded “<em>The flowed transaction could not
be unmarshaled” </em>error commonly experienced when using MSDTC transactions with
WCF, SQL, TxF, etc. I have once again experienced the un-trusted domain scenario,
and can now report with certainty that adding hosts file entries on both machines
will correct the problem. Testing this solution with DTCPing.exe between the two machines
proves that making only the hosts file change acquaints the client and server and
allows distributed transactions to occur.
</p>
        <p>
You will find many blog and forum post non-solutions. Adding the hosts file entry
or the equivalent domain redirects are the only solutions when working with two machines
in disparate, un-trusted domains. Some of the non-solutions you’ll find go so far
as to say to change your SQL connection string to prevent current (ambient) transaction
enlistment. Not quite a complete solution as your first rollback unit test will fail.
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=2d946739-b527-41a7-8422-d29f4149e47a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Web application clients of NetMsmqBinding WCF services (Error 0xc00e002f)</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/02/26/WebApplicationClientsOfNetMsmqBindingWCFServicesError0xc00e002f.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,7d9ad86d-fd3e-4b20-ab02-89679f85d097.aspx</id>
    <published>2010-02-25T22:07:07.44525-05:00</published>
    <updated>2010-02-25T22:07:07.44525-05:00</updated>
    <category term="IIS" label="IIS" scheme="http://offroadcoder.com/CategoryView,category,IIS.aspx" />
    <category term="WCF" label="WCF" scheme="http://offroadcoder.com/CategoryView,category,WCF.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you have a WCF service exposing endpoints with the NetMsmqBinding, you may come
across my old pal, error code 0xc00e002f when you have web application clients. If
you’ve already had your required interactive login on the web server with your AppPool’s
service account and have already registered your AppPool service account’s user certificate
for message queuing, then you should be ok.
</p>
        <p>
If you are using IIS 7 or 7.5, there is one more piece to the puzzle. Go into <em>Advanced
Settings</em> on your Application Pool, and find “Load User Profile” under the <em>Process
Model</em> section. “Load User Profile” on these latest versions of IIS needs to be <strong>true</strong> to
get your service account’s user certificate passed to MSMQ. I fought this for a while
before finally finding it. And now… :)
</p>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=7d9ad86d-fd3e-4b20-ab02-89679f85d097" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Auto-populating ASP.NET MVC “controls” after a post</title>
    <link rel="alternate" type="text/html" href="http://offroadcoder.com/2010/02/01/AutopopulatingASPNETMVCControlsAfterAPost.aspx" />
    <id>http://offroadcoder.com/PermaLink,guid,5d833e28-847b-41a8-905f-549b0f6c1f84.aspx</id>
    <published>2010-01-31T21:50:19.513-05:00</published>
    <updated>2010-01-31T21:50:19.513-05:00</updated>
    <category term="ASP.NET" label="ASP.NET" scheme="http://offroadcoder.com/CategoryView,category,ASPNET.aspx" />
    <category term="ASP.NET MVC" label="ASP.NET MVC" scheme="http://offroadcoder.com/CategoryView,category,ASPNETMVC.aspx" />
    <category term="C#" label="C#" scheme="http://offroadcoder.com/CategoryView,category,C.aspx" />
    <category term="Javascript" label="Javascript" scheme="http://offroadcoder.com/CategoryView,category,Javascript.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m not sure if what I’m doing is actually the right way to create a “user control”
in ASP.NET MVC, but it’s worth sharing this tidbit either way. Instead of using a <em>MVC
View User Control</em> to create a hidden field, a text box, two anchors, and three
JavaScript functions, I chose to put it all in a <em>HtmlHelper</em> in which I write
out the HTML and JavaScript myself. Everything worked fine except the almost magical
auto-repopulating of the hidden and text fields after a post that didn’t work as expected
as in a typical <em>MVC View Page</em>.
</p>
        <p>
          <strong>The situation:</strong> I have a page that needs to be called as a popup from
many pages in my MVC application. The page allows single or multiple selection of
“items” driven by an XML file. In the event that one day, almost always immediately,
I have two or more of these “controls” on one view page, I need the two fields and
the three JavaScript functions to have unique names so they don’t cross paths and
cause unexpected behavior. I had an <em>ASP.NET User Control</em> to do this in plain
old ASP.NET (POAN) since v1.1, and I can’t live without it. 
</p>
        <p>
          <strong>The confusion:</strong> If I were to place the hidden, textbox, anchors, and
JavaScript functions directly in the calling page, something magical happens after
a post. If the controls had values before the post, they appear to magically retain
there values after the post. It wasn’t until a colleague of mine, Sat, and I dug into
Reflector for a while did we realize what was happening. Html.TextBox, Html.Hidden,
and others all do something similar to auto-magically re-populate their values after
the post. Since I’m writing out my fields as &lt;input type=”hidden”/&gt; and &lt;input
type=”text”/&gt;, the magic doesn’t happen.
</p>
        <p>
          <em>      NOTE: The magic will also not happen if you just
write &lt;input type=”text”/&gt; on the page. It only happens if you use Html.TextBox.</em>
        </p>
        <p>
          <strong>The solution:</strong> I am still new to MVC and still trying to wrap my head
around the “right way” to do things. Reflector showed that the <em>HtmlHelpers</em> all
looked at the ModelState in the ViewData before rendering their HTML. They looked
for their value by key (key being the control/tag name), and, if present, used that
as the control/tag’s value. Bing! Maybe I should do the same thing. So just before
I go to town with TagBuilder to assemble my controls/tags, I look in the ViewData’s
ModelState for my value. If it is there, it must have been posted there by me (my
control).
</p>
        <div style="width: 650px; font-family: consolas; background: #3f3f3f; color: #dcdccc; font-size: 9pt">
          <p style="margin: 0px">
            <span style="color: #85ac8d">   48</span>         <span style="color: #2b91af">UrlHelper</span><span style="color: #dfdfbf">urlHelper</span> = <span style="color: #e1e18a; font-weight: bold">new</span><span style="color: #2b91af">UrlHelper</span>(<span style="color: #dfdfbf">helper</span>.<span style="color: #dfdfbf">ViewContext</span>.<span style="color: #dfdfbf">RequestContext</span>);
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   49</span>         <span style="color: #e1e18a; font-weight: bold">string</span><span style="color: #dfdfbf">textValue</span> = <span style="color: #e1e18a; font-weight: bold">null</span>;
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   50</span>         <span style="color: #2b91af">ModelState</span><span style="color: #dfdfbf">state</span>;
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   51</span> 
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   52</span>         <span style="color: #e1e18a; font-weight: bold">if</span> (<span style="color: #dfdfbf">helper</span>.<span style="color: #dfdfbf">ViewData</span>.<span style="color: #dfdfbf">ModelState</span>.<span style="color: #dfdfbf">TryGetValue</span>(<span style="color: #dfdfbf">textFieldName</span>, <span style="color: #e1e18a; font-weight: bold">out</span><span style="color: #dfdfbf">state</span>))
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   53</span>        
{
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   54</span>             <span style="color: #dfdfbf">textValue</span> = <span style="color: #dfdfbf">state</span>.<span style="color: #dfdfbf">Value</span>.<span style="color: #dfdfbf">AttemptedValue</span>;
</p>
          <p style="margin: 0px">
            <span style="color: #85ac8d">   55</span>        
}
</p>
        </div>
        <br />
        <p>
Works like a charm! Now my hidden, textbox, two anchors, and three JavaScript functions
are bundled nicely inside of an <em>HtmlHelper</em> class that looks and feels like
I’m using a built-in ASP.NET MVC <em>HtmlHelper</em> class. Most importantly, I have
the pleasure of typing only this on all my consuming pages.
</p>
        <div style="width: 650px; font-family: consolas; background: #3f3f3f; color: #dcdccc; font-size: 9pt">
          <p style="margin: 0px">
            <span style="color: #85ac8d">   40</span>     <span style="background: #ffee62; color: #000">&lt;%</span><span style="color: #efef8f">=</span><span style="color: #dfdfbf">Html</span>.<span style="color: #dfdfbf">MySelector</span>(<span style="color: #c89191">"selectedIDs"</span>, <span style="color: #c89191">"selectedNames"</span>, <span style="color: #c89191">"State"</span>)<span style="background: #ffee62; color: #000">%&gt;</span></p>
        </div>
        <img width="0" height="0" src="http://offroadcoder.com/aggbug.ashx?id=5d833e28-847b-41a8-905f-549b0f6c1f84" />
      </div>
    </content>
  </entry>
</feed>