<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>freachable.net - .NET</title>
    <link>http://freachable.net/</link>
    <description>Next generation's garbage</description>
    <language>en-us</language>
    <copyright>Hafthor Stefansson</copyright>
    <lastBuildDate>Tue, 12 Apr 2011 21:13:17 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>blog@freachable.net</managingEditor>
    <webMaster>blog@freachable.net</webMaster>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=b934fedb-5eec-4ddd-b1c1-d9ca915ab42e</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,b934fedb-5eec-4ddd-b1c1-d9ca915ab42e.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,b934fedb-5eec-4ddd-b1c1-d9ca915ab42e.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=b934fedb-5eec-4ddd-b1c1-d9ca915ab42e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you are encountering issues with the installer for ASP.NET MVC 3 Tools Update,
try these suggestions: 
</p>
        <ol>
          <li>
Wait. This install really takes a long time.</li>
          <li>
Make sure you exit out of VS.</li>
          <li>
If you are running in a virtual machine, it might not work :( because of #wp7 related
parts in the installer. If you are using Parallels with Boot Camp, like I tell everyone
to do, reboot in Windows, run the install and then switch back to Windows in Parallels.</li>
        </ol>
        <img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=b934fedb-5eec-4ddd-b1c1-d9ca915ab42e" />
      </body>
      <title>ASP.NET MVC 3 Tools Update - you can't spell installer without stall</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,b934fedb-5eec-4ddd-b1c1-d9ca915ab42e.aspx</guid>
      <link>http://freachable.net/2011/04/12/ASPNETMVC3ToolsUpdateYouCantSpellInstallerWithoutStall.aspx</link>
      <pubDate>Tue, 12 Apr 2011 21:13:17 GMT</pubDate>
      <description>&lt;p&gt;
If you are encountering issues with the installer for ASP.NET MVC 3 Tools Update,
try these suggestions: 
&lt;ol&gt;
&lt;li&gt;
Wait. This install really takes a long time.&lt;/li&gt;
&lt;li&gt;
Make sure you exit out of VS.&lt;/li&gt;
&lt;li&gt;
If you are running in a virtual machine, it might not work :( because of #wp7 related
parts in the installer. If you are using Parallels with Boot Camp, like I tell everyone
to do, reboot in Windows, run the install and then switch back to Windows in Parallels.&lt;/li&gt;
&lt;/ol&gt;
&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=b934fedb-5eec-4ddd-b1c1-d9ca915ab42e" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,b934fedb-5eec-4ddd-b1c1-d9ca915ab42e.aspx</comments>
      <category>.NET</category>
      <category>Visual Studio</category>
      <category>WP7</category>
    </item>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=2052daf7-ccd9-4dd1-bd5c-e3d1ca619853</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,2052daf7-ccd9-4dd1-bd5c-e3d1ca619853.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,2052daf7-ccd9-4dd1-bd5c-e3d1ca619853.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=2052daf7-ccd9-4dd1-bd5c-e3d1ca619853</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <a href="http://www.msdnevents.com/wp7devlaunch/">
          <img src="/images/wp7_signature_banner_sm.jpg" style="float:left;margin-right:20px;" border="0" />
        </a>
        <p>
Looks like I will be building an app for WP7 soon, perhaps even before I start on
Android. This looks like such a modern developer friendly platform. I think we will
see waaaay more internal business apps being built for WP7 than iPhone. Not many business
apps were written for Windows in C/C++. I think Objective C is also too low-level
for business apps. 
</p>
        <p>
          <a href="http://www.msdnevents.com/wp7devlaunch/">http://www.msdnevents.com/wp7devlaunch/</a>
        </p>
        <img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=2052daf7-ccd9-4dd1-bd5c-e3d1ca619853" />
      </body>
      <title>Windows 7 Developer Launch - October 12th</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,2052daf7-ccd9-4dd1-bd5c-e3d1ca619853.aspx</guid>
      <link>http://freachable.net/2010/10/01/Windows7DeveloperLaunchOctober12th.aspx</link>
      <pubDate>Fri, 01 Oct 2010 20:54:19 GMT</pubDate>
      <description>&lt;a href="http://www.msdnevents.com/wp7devlaunch/"&gt;&lt;img src="/images/wp7_signature_banner_sm.jpg" style="float:left;margin-right:20px;" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;
Looks like I will be building an app for WP7 soon, perhaps even before I start on
Android. This looks like such a modern developer friendly platform. I think we will
see waaaay more internal business apps being built for WP7 than iPhone. Not many business
apps were written for Windows in C/C++. I think Objective C is also too low-level
for business apps. 
&lt;p&gt;
&lt;a href="http://www.msdnevents.com/wp7devlaunch/"&gt;http://www.msdnevents.com/wp7devlaunch/&lt;/a&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=2052daf7-ccd9-4dd1-bd5c-e3d1ca619853" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,2052daf7-ccd9-4dd1-bd5c-e3d1ca619853.aspx</comments>
      <category>.NET</category>
      <category>Silverlight</category>
      <category>WP7</category>
    </item>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=8d67f8b6-b0e2-42c3-b28e-611c342a53f7</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,8d67f8b6-b0e2-42c3-b28e-611c342a53f7.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,8d67f8b6-b0e2-42c3-b28e-611c342a53f7.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=8d67f8b6-b0e2-42c3-b28e-611c342a53f7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I wanted rounded corners, but with minimal
fuss. I'm using border-radius and variants (-moz, -webkit, -khtml) which is great,
except for on IE, but I found a DHTML behavior (<a href="http://code.google.com/p/curved-corner/">http://code.google.com/p/curved-corner/</a>)
that makes it so IE will appear to have these powers. The trouble is, I'm using SiteFinity
which, like any good CMS, has these virtual folders that don't exist in IIS and url
references to behaviors must be in the same directory.<br /><br />
To fix this, I wrote a quick HttpHandler to all me to capture requests for htc files
and serve them from any path.<br /><br />
Here's the source:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">class</span> HtcAnywhereHandler
: IHttpHandler { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> HtcAnywhereHandler()
{ } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">bool</span> IsReusable
{ get { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">false</span>;
} } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> ProcessRequest(HttpContext
context) { FileInfo fi <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> FileInfo(context.Server.MapPath(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"~/htc/"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> context.Request.Url.Segments[context.Request.Url.Segments.Length <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">-</span> 1])); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">if</span> (fi.Exists
&amp;&amp; fi.Extension.Equals(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">".htc"</span>,
System.StringComparison.InvariantCultureIgnoreCase)) { context.Response.ContentType <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"text/x-component"</span>;
context.Response.BinaryWrite(File.ReadAllBytes(fi.FullName)); } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">else</span> context.Response.StatusCode <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> 404;
} }</span></pre>So now I have an /htc directory where I really store my behavior but
a request to /skljfsfcio/border-radius.htc will serve the /htc/border-radius.htc file.
Yay.<br /><br />
To make this work, you'll need to add an entry to the httpHandlers section in the
web.config<br /><br />
&lt;add verb="GET" path="*.htc" validate="false" type="HtcAnywhereHandler, HtcAnywhere"
/&gt;<br /><br />
Then you need to tell IIS to use ASP.NET for .htc files. Go to the web site properties,
Home Directory tab, [configuration...], add an application extension to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
for .htc, Limit to: "GET", and turn off verify that it exists.<br /><br />
The bummer for me was that in my html that border-radius.htc didn't end up working.
Sigh.<br /><p></p><img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=8d67f8b6-b0e2-42c3-b28e-611c342a53f7" /></body>
      <title>Using HTC Behaviors in SiteFinity or other ASP.NET CMS</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,8d67f8b6-b0e2-42c3-b28e-611c342a53f7.aspx</guid>
      <link>http://freachable.net/2010/07/02/UsingHTCBehaviorsInSiteFinityOrOtherASPNETCMS.aspx</link>
      <pubDate>Fri, 02 Jul 2010 19:40:58 GMT</pubDate>
      <description>I wanted rounded corners, but with minimal fuss. I'm using border-radius and variants (-moz, -webkit, -khtml) which is great, except for on IE, but I found a DHTML behavior (&lt;a href="http://code.google.com/p/curved-corner/"&gt;http://code.google.com/p/curved-corner/&lt;/a&gt;)
that makes it so IE will appear to have these powers. The trouble is, I'm using SiteFinity
which, like any good CMS, has these virtual folders that don't exist in IIS and url
references to behaviors must be in the same directory.&lt;br&gt;
&lt;br&gt;
To fix this, I wrote a quick HttpHandler to all me to capture requests for htc files
and serve them from any path.&lt;br&gt;
&lt;br&gt;
Here's the source:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;class&lt;/span&gt; HtcAnywhereHandler
: IHttpHandler { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; HtcAnywhereHandler()
{ } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;bool&lt;/span&gt; IsReusable
{ get { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;false&lt;/span&gt;;
} } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;void&lt;/span&gt; ProcessRequest(HttpContext
context) { FileInfo fi &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; FileInfo(context.Server.MapPath(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"~/htc/"&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; context.Request.Url.Segments[context.Request.Url.Segments.Length &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;-&lt;/span&gt; 1])); &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; (fi.Exists
&amp;amp;&amp;amp; fi.Extension.Equals(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;".htc"&lt;/span&gt;,
System.StringComparison.InvariantCultureIgnoreCase)) { context.Response.ContentType &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"text/x-component"&lt;/span&gt;;
context.Response.BinaryWrite(File.ReadAllBytes(fi.FullName)); } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;else&lt;/span&gt; context.Response.StatusCode &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; 404;
} }&lt;/span&gt;&lt;/pre&gt;So now I have an /htc directory where I really store my behavior but
a request to /skljfsfcio/border-radius.htc will serve the /htc/border-radius.htc file.
Yay.&lt;br&gt;
&lt;br&gt;
To make this work, you'll need to add an entry to the httpHandlers section in the
web.config&lt;br&gt;
&lt;br&gt;
&amp;lt;add verb="GET" path="*.htc" validate="false" type="HtcAnywhereHandler, HtcAnywhere"
/&amp;gt;&lt;br&gt;
&lt;br&gt;
Then you need to tell IIS to use ASP.NET for .htc files. Go to the web site properties,
Home Directory tab, [configuration...], add an application extension to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
for .htc, Limit to: "GET", and turn off verify that it exists.&lt;br&gt;
&lt;br&gt;
The bummer for me was that in my html that border-radius.htc didn't end up working.
Sigh.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=8d67f8b6-b0e2-42c3-b28e-611c342a53f7" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,8d67f8b6-b0e2-42c3-b28e-611c342a53f7.aspx</comments>
      <category>.NET</category>
      <category>HTML</category>
      <category>SiteFinity</category>
    </item>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=cbcc174d-7746-4ecd-8c98-2fff16d4ab45</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,cbcc174d-7746-4ecd-8c98-2fff16d4ab45.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,cbcc174d-7746-4ecd-8c98-2fff16d4ab45.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=cbcc174d-7746-4ecd-8c98-2fff16d4ab45</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">It's true. I was pretty excited when I
heard about a chance to ride along with Carl Franklin and Richard Campbell of <a href="http://www.dotnetrocks.com">DotNetRocks</a>.
It was a promotion put on by <a href="http://telerik.com">Telerik</a> where one lucky
victim from each city would get to ride in the RV with them to the next city and watch
that show.<br /><br />
Timeline:<br /><ul><li>
Several weeks before - heard about the <a href="http://www.dotnetrocks.com/roadtrip">RoadTrip</a> on
a DotNetRocks episode. Went to the site mentioned, but there wasn't a sign-up form
yet. Set an alarm on my phone to remind me to check the site daily.</li><li>
A couple of weeks before - The form was there. I filled it in. I then told my wife
about it and said that there was a insignificant chance that I might win that. I then
realized that this was going to conflict with <a href="http://www.sqlsaturday.com">SqlSaturday</a> in
Huntington Beach.</li><li>
Monday 4/19 - canceled plans to go to SqlSaturday.</li><li>
Tuesday 4/20 - Beta 2 of a certain smart phone OS broke camera support. Boo. Did take
a pocket camera with, but didn't take many shots with it.<br /></li><li>
Friday 4/23 - went to the DotNetRocks RoadTrip event in Phoenix. Got there right at
6 PM. Chatted with Richard and mentioned how cool I thought the RoadTrip ride-along
was. He said, "You should go." - They were going to pick me up on Saturday. I texted
my wife. I found it rather hard to concentrate during the event.</li><li>
Saturday 4/24 - Carl and Richard drove the RV to my house, around 11 am - crazy -
got onboard and away we went. Bound for Houston, some 1100 miles away. They opted
for driving straight through. Chatted their ears off probably. We jury-rigged the
PA speaker to a MP3 player so we could listen to old episodes of <a href="http://mondays.pwop.com">Mondays</a> on
the drive.<br /><img src="/content/binary/DSC00384s.jpg" /><br /></li><li>
Sunday 4/25 - Pulled in to Houston around 9 am. Around 20 hours with the time difference.
Got a little sleep in the RV and a little more at the hotel after going for a walk.
Later Richard, Tom (driver) and I met up with <a href="http://blogs.msdn.com/zainnab">Zain
Naboulsi</a> (MS Dev Evangelist) for dinner and had some spirited discussions over
a great dinner. Then just hung out with Richard for a couple of hours chatting about
techie nerdy stuff.</li><li>
Monday 4/26 - Met up with <a href="http://diditwith.net/">Dustin Campbell</a> and
had really great sushi with everyone. Totally geeked out with Dustin about languages
and Visual Studio. Then we went to the MS office, setup and they did the show. It
was kinda neat to see them do a second show. Did a <a href="http://www.facebook.com/video/video.php?v=10100263627759734">video</a> interview
with <a href="http://twitter.com/toddanglin">Todd</a> of Telerik about the experience
and we discussed some of the cool stuff in SiteFinity 4.0 CTP. Then we went back to
the hotel. Sadly, the experience was over. Got about 2 hours of sleep then took a
cab to IAH airport and got on my early flight back to PHX.<br /><img src="/content/binary/DSC00385s.jpg" /><br /></li></ul><br />
Really a great time.<br />
Thanks Carl and Richard and Thanks Telerik!<br /><p></p><img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=cbcc174d-7746-4ecd-8c98-2fff16d4ab45" /></body>
      <title>DotNetRocks RoadTrip!</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,cbcc174d-7746-4ecd-8c98-2fff16d4ab45.aspx</guid>
      <link>http://freachable.net/2010/05/04/DotNetRocksRoadTrip.aspx</link>
      <pubDate>Tue, 04 May 2010 18:04:02 GMT</pubDate>
      <description>It's true. I was pretty excited when I heard about a chance to ride 
along with Carl Franklin and Richard Campbell of &lt;a href="http://www.dotnetrocks.com"&gt;DotNetRocks&lt;/a&gt;.
It was a promotion put on by &lt;a href="http://telerik.com"&gt;Telerik&lt;/a&gt; where one lucky
victim from each city would get to ride in the RV with them to the next city and watch
that show.&lt;br&gt;
&lt;br&gt;
Timeline:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Several weeks before - heard about the &lt;a href="http://www.dotnetrocks.com/roadtrip"&gt;RoadTrip&lt;/a&gt; on
a DotNetRocks episode. Went to the site mentioned, but there wasn't a sign-up form
yet. Set an alarm on my phone to remind me to check the site daily.&lt;/li&gt;
&lt;li&gt;
A couple of weeks before - The form was there. I filled it in. I then told my wife
about it and said that there was a insignificant chance that I might win that. I then
realized that this was going to conflict with &lt;a href="http://www.sqlsaturday.com"&gt;SqlSaturday&lt;/a&gt; in
Huntington Beach.&lt;/li&gt;
&lt;li&gt;
Monday 4/19 - canceled plans to go to SqlSaturday.&lt;/li&gt;
&lt;li&gt;
Tuesday 4/20 - Beta 2 of a certain smart phone OS broke camera support. Boo. Did take
a pocket camera with, but didn't take many shots with it.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Friday 4/23 - went to the DotNetRocks RoadTrip event in Phoenix. Got there right at
6 PM. Chatted with Richard and mentioned how cool I thought the RoadTrip ride-along
was. He said, "You should go." - They were going to pick me up on Saturday. I texted
my wife. I found it rather hard to concentrate during the event.&lt;/li&gt;
&lt;li&gt;
Saturday 4/24 - Carl and Richard drove the RV to my house, around 11 am - crazy -
got onboard and away we went. Bound for Houston, some 1100 miles away. They opted
for driving straight through. Chatted their ears off probably. We jury-rigged the
PA speaker to a MP3 player so we could listen to old episodes of &lt;a href="http://mondays.pwop.com"&gt;Mondays&lt;/a&gt; on
the drive.&lt;br&gt;
&lt;img src="/content/binary/DSC00384s.jpg"&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Sunday 4/25 - Pulled in to Houston around 9 am. Around 20 hours with the time difference.
Got a little sleep in the RV and a little more at the hotel after going for a walk.
Later Richard, Tom (driver) and I met up with &lt;a href="http://blogs.msdn.com/zainnab"&gt;Zain
Naboulsi&lt;/a&gt; (MS Dev Evangelist) for dinner and had some spirited discussions over
a great dinner. Then just hung out with Richard for a couple of hours chatting about
techie nerdy stuff.&lt;/li&gt;
&lt;li&gt;
Monday 4/26 - Met up with &lt;a href="http://diditwith.net/"&gt;Dustin Campbell&lt;/a&gt; and
had really great sushi with everyone. Totally geeked out with Dustin about languages
and Visual Studio. Then we went to the MS office, setup and they did the show. It
was kinda neat to see them do a second show. Did a &lt;a href="http://www.facebook.com/video/video.php?v=10100263627759734"&gt;video&lt;/a&gt; interview
with &lt;a href="http://twitter.com/toddanglin"&gt;Todd&lt;/a&gt; of Telerik about the experience
and we discussed some of the cool stuff in SiteFinity 4.0 CTP. Then we went back to
the hotel. Sadly, the experience was over. Got about 2 hours of sleep then took a
cab to IAH airport and got on my early flight back to PHX.&lt;br&gt;
&lt;img src="/content/binary/DSC00385s.jpg"&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
Really a great time.&lt;br&gt;
Thanks Carl and Richard and Thanks Telerik!&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=cbcc174d-7746-4ecd-8c98-2fff16d4ab45" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,cbcc174d-7746-4ecd-8c98-2fff16d4ab45.aspx</comments>
      <category>.NET</category>
    </item>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=21859f16-e104-4e84-ad38-3a118b1ee8e0</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,21859f16-e104-4e84-ad38-3a118b1ee8e0.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,21859f16-e104-4e84-ad38-3a118b1ee8e0.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=21859f16-e104-4e84-ad38-3a118b1ee8e0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Tahoma">
            <span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">Wanted
a generic way to pass a DataTable as a parameter to SqlCommand as a TVP (Table Value
Parameter). It automatically creates the, IMHO, superfluous User-Defined Table Types.
Here's what I have so far:</span>
          </font>
          <br />
        </p>
        <pre>
          <span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">
            <pre>
              <span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;Runtime.CompilerServices.Extension()&gt;
_ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Sub</span> AddTableParameter(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">ByVal</span> cmd <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> SqlCommand, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">ByVal</span> n <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">String</span>, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">ByVal</span> dt <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> DataTable) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Static</span> typeXlat <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> Dictionary(Of
System.Type, SqlDbType) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span> typeXlat <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Is</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Nothing</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Then</span> typeXlat <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">New</span> Dictionary(Of
System.Type, SqlDbType) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(Int64),
SqlDbType.BigInt) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(Int32),
SqlDbType.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Int</span>)
typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(Int16),
SqlDbType.SmallInt) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Byte</span>),
SqlDbType.TinyInt) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(SByte),
SqlDbType.TinyInt) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Boolean</span>),
SqlDbType.Bit) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">String</span>),
SqlDbType.VarChar) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Byte</span>()),
SqlDbType.VarBinary) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(DateTime),
SqlDbType.DateTime) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(DateTimeOffset),
SqlDbType.DateTimeOffset) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Char</span>),
SqlDbType.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Char</span>)
typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Single</span>),
SqlDbType.Real) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Double</span>),
SqlDbType.Float) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Decimal</span>),
SqlDbType.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Decimal</span>)
typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(Guid),
SqlDbType.UniqueIdentifier) typeXlat.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">GetType</span>(Xml.XmlDocument),
SqlDbType.Xml) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">'assembly
the typename and spec</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Dim</span> tabletypedef <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">New</span> List(Of <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">String</span>) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Dim</span> parm <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">New</span> SqlParameter(n,
SqlDbType.Structured) parm.Value <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> dt <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">For</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Each</span> c <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> DataColumn <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">In</span> dt.Columns <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Dim</span> s <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> SqlDbType <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> SqlDbType.Variant <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span> typeXlat.ContainsKey(c.DataType) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Then</span> s <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> typeXlat(c.DataType)
tabletypedef.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(c.ColumnName <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"
"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> s.ToString) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Next</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Dim</span> tabledef <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">String</span>.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Join</span>(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">","</span>,
tabletypedef.ToArray) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Dim</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">typename</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"autotype_"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> tabledef
parm.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">TypeName</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"["</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">typename</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"]"</span><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">'create
the type if needed</span> Using cmd2 <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">New</span> SqlCommand(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"select
count(*) from sys.types where is_table_type=1 and name='"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">typename</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"'"</span>,
cmd.Connection) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span> cmd2.ExecuteScalar() <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> 0 <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Then</span> cmd2.CommandText <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"create
type ["</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">typename</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"]
as table("</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> tabledef <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">")"</span> cmd2.ExecuteNonQuery() <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span> Using <span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">'add
the parm referencing the typename</span> cmd.Parameters.<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Add</span>(parm) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Sub</span></span>
            </pre>
            <br />
            <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">
            </span>
          </span>
        </pre>
        <p>
        </p>
        <img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=21859f16-e104-4e84-ad38-3a118b1ee8e0" />
      </body>
      <title>Not Texturized Vegetable Protein</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,21859f16-e104-4e84-ad38-3a118b1ee8e0.aspx</guid>
      <link>http://freachable.net/2010/03/26/NotTexturizedVegetableProtein.aspx</link>
      <pubDate>Fri, 26 Mar 2010 02:54:18 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face="Tahoma"&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Wanted
a generic way to pass a DataTable as a parameter to SqlCommand as a TVP (Table Value
Parameter). It automatically creates the, IMHO, superfluous User-Defined Table Types.
Here's what I have so far:&lt;/span&gt;&lt;/font&gt; 
&lt;br&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&amp;lt;Runtime.CompilerServices.Extension()&amp;gt;
_ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Sub&lt;/span&gt; AddTableParameter(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;ByVal&lt;/span&gt; cmd &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; SqlCommand, &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;ByVal&lt;/span&gt; n &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;String&lt;/span&gt;, &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;ByVal&lt;/span&gt; dt &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; DataTable) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Static&lt;/span&gt; typeXlat &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; Dictionary(Of
System.Type, SqlDbType) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; typeXlat &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Is&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Nothing&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Then&lt;/span&gt; typeXlat &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;New&lt;/span&gt; Dictionary(Of
System.Type, SqlDbType) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(Int64),
SqlDbType.BigInt) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(Int32),
SqlDbType.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Int&lt;/span&gt;)
typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(Int16),
SqlDbType.SmallInt) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Byte&lt;/span&gt;),
SqlDbType.TinyInt) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(SByte),
SqlDbType.TinyInt) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Boolean&lt;/span&gt;),
SqlDbType.Bit) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;String&lt;/span&gt;),
SqlDbType.VarChar) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Byte&lt;/span&gt;()),
SqlDbType.VarBinary) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(DateTime),
SqlDbType.DateTime) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(DateTimeOffset),
SqlDbType.DateTimeOffset) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Char&lt;/span&gt;),
SqlDbType.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Char&lt;/span&gt;)
typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Single&lt;/span&gt;),
SqlDbType.Real) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Double&lt;/span&gt;),
SqlDbType.Float) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Decimal&lt;/span&gt;),
SqlDbType.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Decimal&lt;/span&gt;)
typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(Guid),
SqlDbType.UniqueIdentifier) typeXlat.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;GetType&lt;/span&gt;(Xml.XmlDocument),
SqlDbType.Xml) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; &lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;'assembly
the typename and spec&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Dim&lt;/span&gt; tabletypedef &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;New&lt;/span&gt; List(Of &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;String&lt;/span&gt;) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Dim&lt;/span&gt; parm &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;New&lt;/span&gt; SqlParameter(n,
SqlDbType.Structured) parm.Value &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; dt &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;For&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Each&lt;/span&gt; c &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; DataColumn &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;In&lt;/span&gt; dt.Columns &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Dim&lt;/span&gt; s &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; SqlDbType &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; SqlDbType.Variant &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; typeXlat.ContainsKey(c.DataType) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Then&lt;/span&gt; s &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; typeXlat(c.DataType)
tabletypedef.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(c.ColumnName &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"
"&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; s.ToString) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Next&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Dim&lt;/span&gt; tabledef &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;String&lt;/span&gt;.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Join&lt;/span&gt;(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;","&lt;/span&gt;,
tabletypedef.ToArray) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Dim&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;typename&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"autotype_"&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; tabledef
parm.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;TypeName&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"["&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;typename&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"]"&lt;/span&gt; &lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;'create
the type if needed&lt;/span&gt; Using cmd2 &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;New&lt;/span&gt; SqlCommand(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"select
count(*) from sys.types where is_table_type=1 and name='"&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;typename&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"'"&lt;/span&gt;,
cmd.Connection) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; cmd2.ExecuteScalar() &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; 0 &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Then&lt;/span&gt; cmd2.CommandText &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"create
type ["&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;typename&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"]
as table("&lt;/span&gt; &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; tabledef &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;+&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;")"&lt;/span&gt; cmd2.ExecuteNonQuery() &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; Using &lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;'add
the parm referencing the typename&lt;/span&gt; cmd.Parameters.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Add&lt;/span&gt;(parm) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=21859f16-e104-4e84-ad38-3a118b1ee8e0" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,21859f16-e104-4e84-ad38-3a118b1ee8e0.aspx</comments>
      <category>.NET</category>
      <category>SQL</category>
    </item>
  </channel>
</rss>