<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-949060813444146008</id><updated>2011-09-15T16:03:33.349-04:00</updated><category term='web services'/><title type='text'>The midnight coder</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-2982960148957610911</id><published>2010-12-01T16:20:00.060-05:00</published><updated>2010-12-01T17:56:31.176-05:00</updated><title type='text'>Seagate Dockstar - Install Debian Linux</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Step 1: Disable the Pogoplug services&lt;br /&gt;&lt;/span&gt;- SSH into the DockStar&lt;br /&gt;- command: &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"killall hbwd"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2: Attach and configure the USB device&lt;br /&gt;&lt;/span&gt;- use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;fdisk (&lt;/span&gt;instructions &lt;a href="http://jeff.doozan.com/debian/"&gt;here&lt;/a&gt;)&lt;br /&gt;- create 2 partitions: 1st partition type 83 (Linux), second partition type 82 (Linux Swap)&lt;br /&gt;- mark partition 1 as bootable&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3: Install Debian Linux&lt;/span&gt;&lt;br /&gt;- use instructions &lt;a href="http://jeff.doozan.com/debian/"&gt;here&lt;/a&gt;&lt;br /&gt;- this will take a while, after it is finished it will ask you to reboot&lt;br /&gt;- log back in using SSH (PuTTY)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the device does not boot into your new Debian install, you maye have a USB stick that is not suitable for booting from it. Try a "warm boot" by using a pen to push the "Reset" button on the right side of the DockStar.).&lt;/li&gt;&lt;li&gt;The device may have a different IP address now (check that using your router)&lt;/li&gt;&lt;li&gt; to troubleshoot you can use netconsole as described &lt;a href="http://forum.doozan.com/read.php?3,14,14"&gt;here&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;- change root password using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"passwd"&lt;/span&gt; command&lt;br /&gt;- change the host name by editing the file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"/etc/hostname"&lt;/span&gt; using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;vi&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nano&lt;/span&gt;&lt;br /&gt;- set the timezone by using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"dpkg-reconfigure tzdata"&lt;/span&gt;&lt;br /&gt;- optionally, install an updated Kernel from &lt;a href="http://forum.doozan.com/read.php?2,582"&gt;here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4: Additional Configuration&lt;/b&gt;&lt;br /&gt;- install nano editor &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"apt-get install nano"&lt;/span&gt;&lt;br /&gt;- install sudo with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"apt-get install sudo"&lt;/span&gt;&lt;br /&gt;- add additional users with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;"adduser"&lt;/span&gt;&lt;br /&gt;- install other packages for internet radio, samba, I2C etc. (will be covered in later posts)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5: make a copy/backup of your system&lt;/b&gt;&lt;br /&gt;If you have the system configured and running, you can make a backup copy onto another USB stick with the following command:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;dd if=/dev/sda of=/dev/sdb&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This assumes that the boot USB drive is /dev/sda and the traget drive is /dev/sdb&lt;br /&gt;ALL DATA ON /dev/sdb WILL BE ERASED!&lt;br /&gt;&lt;br /&gt;Related links:&lt;br /&gt;&lt;a href="http://www.amb.org/forum/other-devices-f37/hackable-linux-openwrt-ethernet-board-t526.html"&gt;DIY Audio - hackable linux (openWRT) ethernet board&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mikrocontroller.net/articles/Dockstar"&gt;http://www.mikrocontroller.net/articles/Dockstar&lt;/a&gt; &lt;br /&gt;&lt;a href="http://ahsoftware.de/dockstar/"&gt;http://ahsoftware.de/dockstar/&lt;/a&gt; &lt;br /&gt;&lt;a href="http://www.rudiswiki.de/wiki/DockStarDebian"&gt;http://www.rudiswiki.de/wiki/DockStarDebian&lt;/a&gt;&lt;br /&gt;&lt;a href="http://plugapps.com/index.php5?title=Ten%28ish%29_steps_to_setting_up_a_Seagate_Dockstar"&gt;Ten(ish) steps to setting up a Seagate Dockstar&lt;/a&gt;&lt;br /&gt;&lt;a href="http://anwendungsentwickler.ws/dockstar_freeagent_bekommt_zuwachs/entry/316/"&gt;http://anwendungsentwickler.ws/dockstar_freeagent_bekommt_zuwachs/entry/316/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-2982960148957610911?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/2982960148957610911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=2982960148957610911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2982960148957610911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2982960148957610911'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2010/12/seagate-dockstar-install-debian.html' title='Seagate Dockstar - Install Debian Linux'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-5281695298030268680</id><published>2008-12-16T12:04:00.004-05:00</published><updated>2008-12-16T12:49:44.583-05:00</updated><title type='text'>VB.Net and Optional Parameters - watch out!</title><content type='html'>I read somewhere recently that C# 4.0 will also have optional parameters, like VB6 and VB.Net had all along.&lt;br /&gt;When moving to .Net I decided not to use optional parameters in VB.net since they were kind of looked at as a remnant of VB6, not CLR compliant, not available in C# etc.&lt;br /&gt;&lt;br /&gt;And the "preferred way" was to use overloads instead of Optional Parameters.&lt;br /&gt;&lt;br /&gt;So now after I read that C# 4.0 will have optional parameters (and the fact that I am kind of "over" the many overloads that are sometimes necessary, especially if you have logging methods etc.) I was thinking of going back to using Optional Parameters.&lt;br /&gt;&lt;br /&gt;I always assumed that the compiler for VB.Net would just created the overloads in the background, substituting it with the default values given to the Optional Parameters.&lt;br /&gt;&lt;br /&gt;But that is not the case. The compile hard-compiles the default values into the CALLING method/object and not as an overload into the called method.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://discuss.joelonsoftware.com/default.asp?dotnet.12.301457.9"&gt;Joel On Software&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://cesarafonso.blogspot.com/2008/06/vbnet-optional-parameters.html"&gt;VB.NET Optional parameters&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jelle.druyts.net/2003/05/17/OptionalParametersVBNET.aspx"&gt; Optional Parameters (VB.NET)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now this was a big red flag for me, because that means each time you change the value of one of the default parameters, you would need to recompile ALL the CALLING classes as well (if they call with some of the optional parameters omitted).&lt;br /&gt;&lt;br /&gt;So if you have a live enterprise system with multiple DLLs and you need to deploy hotfixes as individual DLLs then you'd have to deploy the changed DLL and all the DLLs that call it. Otherwise the "old" DLLs will still call your method with the "old" default value and this could introduce some hard-to-find side effects.&lt;br /&gt;&lt;br /&gt;One might argue how often do you really need to change the default value of an Optional Parameter and that that indicates a deeper design issue.&lt;br /&gt;But still, for complex system or legacy code that you are refactoring this might be a real possibility.&lt;br /&gt;&lt;br /&gt;Furthermore in VB.Net 3.5 you cannot use Nullable types as optional parameters, i.e. you cannot do this: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Public Sub DoStuff(Optional ByVal intEntityID As Nullable(Of Integer) = Nothing)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;So my conclusion at this point is to stick with overloads instead of Optional Parameters. More predictable and less things to remember as possible pitfalls. :)&lt;br /&gt;I got enough other stuff to cram into my head ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-5281695298030268680?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/5281695298030268680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=5281695298030268680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5281695298030268680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5281695298030268680'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/12/vbnet-and-optional-parameters-watch-out.html' title='VB.Net and Optional Parameters - watch out!'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-4872619939468374670</id><published>2008-11-13T08:46:00.003-05:00</published><updated>2008-11-13T08:52:34.296-05:00</updated><title type='text'>HTTP concurrent connections from IE - AJAX</title><content type='html'>I have been stumbling across articles about the two-concurrent-connection limit of IE7 recently. &lt;br /&gt;Tools like the Visual Round Trip Analyzer from Microsoft also mention this in the set of criteria they evaluate against.&lt;br /&gt;It seems that in IE8 the limit of 2 connections is increased to 6 as per here:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc304129(VS.85).aspx"&gt;AJAX - Connectivity Enhancements in Internet Explorer 8&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But it can also be tweaked in IE7 and below as decsribed in the KB article:&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/183110"&gt;http://support.microsoft.com/kb/183110&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Other links:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/dd188562.aspx"&gt;12 Steps To Faster Web Pages With Visual Round Trip Analyzer&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2008/06/06/case-study-much-ado-about-browser-s-http-connection.aspx"&gt;Case Study: Much ado about Browser's HTTP connection&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-4872619939468374670?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/4872619939468374670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=4872619939468374670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4872619939468374670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4872619939468374670'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/11/http-concurrent-connections-from-ie.html' title='HTTP concurrent connections from IE - AJAX'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-5373023518865270946</id><published>2008-11-07T17:02:00.006-05:00</published><updated>2008-11-07T17:08:14.903-05:00</updated><title type='text'>Nested JOINS (mix of inner and outer joins in SQL)</title><content type='html'>I just ran into this today:&lt;br /&gt;&lt;a href="http://weblogs.sqlteam.com/jeffs/archive/2007/10/11/mixing-inner-outer-joins-sql.aspx"&gt;Be Careful When Mixing INNER and OUTER Joins&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It's not rocket science, but it can be somewhat counter-intuitive. How to tell the SQL server query engine what you want as an inner join vs an outer join.&lt;br /&gt;&lt;br /&gt;I ended up using the nested join syntax by the way, seems cleanest to me and is not relying on the position of the JOIN line in the query.&lt;br /&gt;&lt;br /&gt;Basically:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;&lt;br /&gt;select People.PersonName, Pets.PetName, PetTypes.PetType&lt;br /&gt;from People&lt;br /&gt;left outer join&lt;br /&gt;  (Pets inner join PetTypes on Pets.PetTypeID = PetTypes.PetTypeID)&lt;br /&gt;on Pets.OwnerID = People.PersonID&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-5373023518865270946?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/5373023518865270946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=5373023518865270946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5373023518865270946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5373023518865270946'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/11/nested-joins-mix-of-inner-and-outer.html' title='Nested JOINS (mix of inner and outer joins in SQL)'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-8903571142839207146</id><published>2008-11-03T08:40:00.001-05:00</published><updated>2008-11-03T08:42:05.971-05:00</updated><title type='text'>Stored Procedures - Best Practices</title><content type='html'>Excellent post where Aaron Bertrand shares his best practices for developing stored procedures covering both coding style as well as some coding best practices (good use of NOCOUNT etc).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2008/10/30/my-stored-procedure-best-practices-checklist.aspx"&gt;http://sqlblog.com/blogs/aaron_bertrand/archive/2008/10/30/my-stored-procedure-best-practices-checklist.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-8903571142839207146?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/8903571142839207146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=8903571142839207146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8903571142839207146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8903571142839207146'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/11/stored-procedures-best-practices.html' title='Stored Procedures - Best Practices'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-8909762024042454316</id><published>2008-11-03T08:38:00.006-05:00</published><updated>2008-11-03T08:59:17.285-05:00</updated><title type='text'>Windows Azure - behold the cloud</title><content type='html'>A lot of buzz is being generated at the moment about the Microsoft Azure Services platform. Here is a brief collection of links to get started on it.&lt;br /&gt;&lt;br /&gt;Microsoft’s official Azure site, containing links to the key parts of the platform and documentation:&lt;br /&gt;&lt;a href="http://www.microsoft.com/azure/default.mspx"&gt;http://www.microsoft.com/azure/default.mspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Microsoft's official press release:&lt;br /&gt;&lt;a href="http://www.microsoft.com/presspass/press/2008/oct08/10-27PDCDay1PR.mspx"&gt;http://www.microsoft.com/presspass/press/2008/oct08/10-27PDCDay1PR.mspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Overview blog post by Paul Gielens:&lt;br /&gt;&lt;a href="http://weblogs.asp.net/pgielens/archive/2008/10/27/a-lap-around-windows-azure.aspx"&gt;http://weblogs.asp.net/pgielens/archive/2008/10/27/a-lap-around-windows-azure.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some details on how the Windows Azure back end infrastructure is laid out:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/domgreen/archive/2008/10/30/windows-azure-back-end.aspx"&gt;http://blogs.msdn.com/domgreen/archive/2008/10/30/windows-azure-back-end.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Getting Started with Windows Azure - The Cloud Computing Tools Team has a nice post gathering together the downloads, tools and some information about the tools and SDK:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/cloud/archive/2008/10/27/getting-started-windows-azure-tools-for-microsoft-visual-studio.aspx"&gt;http://blogs.msdn.com/cloud/archive/2008/10/27/getting-started-windows-azure-tools-for-microsoft-visual-studio.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's a tutorial on the process of storing information in Azure with plenty of screenshots and code samples included in the post:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/jnak/archive/2008/10/29/walkthrough-simple-blob-storage-sample.aspx"&gt;http://blogs.msdn.com/jnak/archive/2008/10/29/walkthrough-simple-blob-storage-sample.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A tutorial on the process of getting up and running with Azure, from setting up the development environment to publishing your first application:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/olavt/archive/2008/10/30/how-to-create-and-publish-your-first-windows-azure-application.aspx"&gt;http://blogs.msdn.com/olavt/archive/2008/10/30/how-to-create-and-publish-your-first-windows-azure-application.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Clemens Vasters blogs about the Microsoft .Net ServiceBus that is part of the Azure platform:&lt;br /&gt;&lt;a href="http://vasters.com/clemensv/PermaLink,guid,92d78bee-2cfd-4a29-95ab-c5abb9b905e7.aspx"&gt;http://vasters.com/clemensv/PermaLink,guid,92d78bee-2cfd-4a29-95ab-c5abb9b905e7.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-8909762024042454316?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/8909762024042454316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=8909762024042454316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8909762024042454316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8909762024042454316'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/11/windows-azure-back-end-overview.html' title='Windows Azure - behold the cloud'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-1571923554617083801</id><published>2008-08-05T02:03:00.004-04:00</published><updated>2008-08-05T02:11:23.116-04:00</updated><title type='text'>Copy data between 2 SQL servers - Take 2</title><content type='html'>Alright, so one of the issues &lt;a href="http://midnight-coder.blogspot.com/2007/02/copy-data-between-2-sql-servers.html"&gt;my previous post&lt;/a&gt; did not address was the treatment of Identity columns when using BCP and BULK import.&lt;br /&gt;By default, identity column data is not part of a BCP export, so when doing a BULK IMPORT SQL server will assign new values to the identity Column .&lt;br /&gt;Fortunately, that is relatively easy to address, as decribed here:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms186335.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms186335.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Basically when doing a BCP export, add the "-E" parameter.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Example:&lt;br /&gt;bcp Northwind.dbo.Authors out C:\Temp\DataExport.dat -n -E -T -S MPDESKTOP\SQL2005&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;And when importing, use the KEEPIDENTITY parameter in the BULK INSERT like this:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;USE Northwind&lt;br /&gt;GO&lt;br /&gt;BULK INSERT Authors&lt;br /&gt;FROM 'G:\Transfer\Tempfiles\DataExport.dat'&lt;br /&gt;WITH (KEEPIDENTITY, DATAFILETYPE='native');&lt;br /&gt;GO&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This will preserve the values of identity columns when copying data between 2 servers/databases. Keep in mind that there still might be issue with referential integrity constraints etc. that you need to address when moving data between databases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-1571923554617083801?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/1571923554617083801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=1571923554617083801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1571923554617083801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1571923554617083801'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/08/copy-data-between-2-sql-servers-take-2.html' title='Copy data between 2 SQL servers - Take 2'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-587372906880338155</id><published>2008-06-10T12:07:00.004-04:00</published><updated>2008-06-10T12:24:10.847-04:00</updated><title type='text'>Updating the Main UI from a different thread</title><content type='html'>As you probably know, the availability of threading in .Net can lead to all kinds of little surprises, together of course with the power to write much more responsive applications.&lt;br /&gt;For instance if you have a WinForms app that spawns a worker thread, and then that worker thread needs to update any UI elements on the main form, it will not work, since you can only update UI elements from the same thread they are created on.&lt;br /&gt;I specifically ran into this when using a custom NUnit TestRunner (&lt;a href="http://midnight-coder.blogspot.com/2008/06/implement-your-own-nunit-testrunner_10.html"&gt;see previous post&lt;/a&gt;). It turns out, the TestRunner runs the test fixtures on a different thread, so you can't just do a &lt;span style="font-weight:bold;"&gt;frmMain.txtMessage.Text = "New Text from Test Fixture"&lt;/span&gt;. Would have been too easy.&lt;br /&gt;&lt;br /&gt;In addition, VB.Net also has the concept of default form instances, so when you do the above &lt;span style="font-weight:bold;"&gt;"frmMain.txtMessage"&lt;/span&gt; from a different thread than the main UI thread, VB.Net actually instantiates a new form, and then discards it when you are done. Thus there will be no exception raised for the above code, and putting in a brekpoint in the work thread shows the text properly updated. But in the UI the textbox will be empty.&lt;br /&gt;It is much better explained in &lt;a href="http://blogs.msdn.com/tobint/archive/2006/04/11/573772.aspx"&gt;this post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But the gist of it is this:&lt;br /&gt;&lt;br /&gt;1. You have to use &lt;span style="font-weight:bold;"&gt;My.Application.OpenForms&lt;/span&gt; to get the correct UI thread instance of your form that you want to update&lt;br /&gt;&lt;br /&gt;2. you have to use Invoke/BeginInvoke together with delegates to properly update the controls on the Main UI thread from a different thread.&lt;br /&gt;&lt;br /&gt;3. The Control base class has a neat little method called &lt;span style="font-weight:bold;"&gt;InvokeRequired &lt;/span&gt;that will return True if the method is called from a different thread. This way you can write a generic function that works both on the UI thread and from other threads. Something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;br /&gt;Public Class frmMain&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    'some magic voodo that needs to be done here to allow updating of the text box from a different thread &lt;br /&gt;&amp;nbsp;&amp;nbsp;    Private Delegate Sub PostMessageDelegate(ByVal strNewMessage As String)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    'this is part 2 of the magic voodo: this is a public method that will be called on this form from the &lt;br /&gt;&amp;nbsp;&amp;nbsp;    'outside, from different threads, so the text box can be updated &lt;br /&gt;&amp;nbsp;&amp;nbsp;    Public Sub PostMessage(ByVal strMessage As String)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        If txtMessages.InvokeRequired Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            'this method is called form a different thread, so we need to use BeginInvoke to update the UI&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            txtMessages.BeginInvoke(New PostMessageDelegate(AddressOf PostMessage), New Object() {strMessage})&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            txtMessages.Text &amp;= Environment.NewLine &amp; strMessage&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;    End Sub&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-587372906880338155?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/587372906880338155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=587372906880338155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/587372906880338155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/587372906880338155'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/06/updating-main-ui-from-different-thread.html' title='Updating the Main UI from a different thread'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-3538800580500289732</id><published>2008-06-10T08:41:00.007-04:00</published><updated>2008-06-10T09:05:21.438-04:00</updated><title type='text'>Implement your own NUnit TestRunner - Part 2</title><content type='html'>After I blogged about creating a basic NUnit TestRunner in &lt;a href="http://midnight-coder.blogspot.com/2008/06/implement-your-own-nunit-testrunner.html"&gt;Part 1&lt;/a&gt; of this series, this is the follow-up that shows how to extract and display the test results in a simple fashion.&lt;br /&gt;Basically the TestResult object that is being returned from the Run method of the TestRunner contains probably most of the information you need.&lt;br /&gt;Here is the Code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;br /&gt;Imports System.Text&lt;br /&gt;Imports System.Xml&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports System.Reflection&lt;br /&gt;Imports System.Resources&lt;br /&gt;Imports NUnit.Core&lt;br /&gt;Imports NUnit.Util&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Public Class Form1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    Private Sub btnRunTests_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRunTests.Click&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objTestRunner As TestRunner = Nothing&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        objTestRunner = New RemoteTestRunner()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim strMyFileName As String = Assembly.GetExecutingAssembly().Location   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objPackage As TestPackage = New TestPackage(strMyFileName)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        objTestRunner.Load(objPackage)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        'run the test and create the result&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objTestResult As TestResult = objTestRunner.Run(New NullListener)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        'get the result summary in XML format&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim strResultSummary As String = CreateXmlOutput(objTestResult)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        'now transform the XML into more display-friendly code using the default style sheet &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim sbResultSummary As New StringBuilder&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objXFormReader As XmlTextReader = GetTransformReader(Nothing)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objXMLXform As XmlResultTransform = New XmlResultTransform(objXFormReader)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        objXMLXform.Transform(New StringReader(strResultSummary), New StringWriter(sbResultSummary))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        txtResults.Text = sbResultSummary.ToString()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    Private Shared Function CreateXmlOutput(ByVal objResult As TestResult) As String&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim sbXML As New StringBuilder()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objResultVisitor As New XmlResultVisitor(New StringWriter(sbXML), objResult)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        objResult.Accept(objResultVisitor)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        objResultVisitor.Write()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Return sbXML.ToString()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    End Function 'CreateXmlOutput&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    Private Shared Function GetTransformReader(ByVal strXSLFileName As String) As XmlTextReader&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Dim objXMLReader As XmlTextReader = Nothing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        If String.IsNullOrEmpty(strXSLFileName) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            Dim objNUnitAssembly As Assembly = Assembly.GetAssembly(GetType(XmlResultVisitor))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            Dim objResourceMgr As New ResourceManager("NUnit.Util.Transform", objNUnitAssembly)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            Dim strXmlData As String = CStr(objResourceMgr.GetObject("Summary.xslt"))&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            objXMLReader = New XmlTextReader(New StringReader(strXmlData))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            Dim objXsltInfo As New FileInfo(strXSLFileName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            If Not objXsltInfo.Exists Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                Throw New FileNotFoundException("Transform file: {0} does not exist", objXsltInfo.FullName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                objXMLReader = Nothing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                objXMLReader = New XmlTextReader(objXsltInfo.FullName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        Return objXMLReader&lt;br /&gt;&amp;nbsp;&amp;nbsp;    End Function 'GetTransformReader&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;this will then show the results in a user-friendly form in the text box &lt;span style="font-weight:bold;"&gt;txtResults&lt;/span&gt;.&lt;br /&gt;Where this comes in handy is if you have a WinForms App and you want to run your Unit tests as part of the WinForms app without having to launch the NUnit GUI (or Console).&lt;br /&gt;This is admittedly a very simple implementation, does not have a lot of the bells and whistles of a more graphical UI, but it tells you which tests failed and how long they took and where they failed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-3538800580500289732?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/3538800580500289732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=3538800580500289732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3538800580500289732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3538800580500289732'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/06/implement-your-own-nunit-testrunner_10.html' title='Implement your own NUnit TestRunner - Part 2'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-6314950085973811703</id><published>2008-06-10T00:43:00.009-04:00</published><updated>2008-06-10T01:01:02.767-04:00</updated><title type='text'>Implement your own NUnit TestRunner - Part 1</title><content type='html'>I wanted to be able to run NUnit unit tests from my own test runner within a WinForms App. Easier said than done, not  a lot of examples out there. I looked through the NUnit-Console code and the NUnit-Gui code and pieced together bits and pieces. Then I also stumbled across this blog post from a fellow german which helped with the last stumbling block:&lt;br /&gt;&lt;a href="http://achblah.blogspot.com/2007/04/monocov-and-my-contribution-to-it.html"&gt;http://achblah.blogspot.com/2007/04/monocov-and-my-contribution-to-it.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The end result is this piece of VB.net code that will run any tests within your current EXE:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-weight: bold;font-family:courier new;" &gt;Imports System.Reflection&lt;br /&gt;Imports NUnit.Core&lt;br /&gt;Imports NUnit.Util&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Public Class Form1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;Private Sub btnRunTests_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRunTests.Click&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim objTestRunner As TestRunner = Nothing&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objTestRunner = New RemoteTestRunner()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim strMyFileName As String = Assembly.GetExecutingAssembly().Location  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim objPackage As TestPackage = New TestPackage(strMyFileName)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objTestRunner.Load(objPackage)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objTestRunner.Run(New NullListener)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;End Sub&lt;br /&gt;End Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Of course this does not show any test results or exceptions because of using the "NullListener". In Part 2 I will fix that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-6314950085973811703?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/6314950085973811703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=6314950085973811703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6314950085973811703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6314950085973811703'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/06/implement-your-own-nunit-testrunner.html' title='Implement your own NUnit TestRunner - Part 1'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-6407668185819487453</id><published>2008-04-18T08:19:00.003-04:00</published><updated>2008-06-05T10:17:12.421-04:00</updated><title type='text'>Life Cycle of static variables in ASP.Net</title><content type='html'>Have you ever wondered about the scope and life time of static (Shared in VB.Net) variables in ASP.Net?&lt;br /&gt;- Do they get destroyed after each requests? &lt;br /&gt;- Do they get destroyed after the IIS services is restarted?&lt;br /&gt;- multiple apps run in the same Application Pool, do they all get the same copy (and value) of static variables?&lt;br /&gt;- Does a Singleton make sense in ASP.Net&lt;br /&gt;&lt;br /&gt;Here is what I could gather from doing some research on the web:&lt;br /&gt;&lt;br /&gt;- static variables work in ASP.Net the same way they work in a Windows app: they are global across the whole .Net AppDomain&lt;br /&gt;- each ASP.Net application gets their own AppDomain, even if they are hosted in the same application pool (same w3wp.exe or aspnet_wp.exe)&lt;br /&gt;- so even if you have multiple ASP.Net applications per Application Pool, they would still get their own AppDomains, and thus the singletons/shared variables would be isolated from each other&lt;br /&gt;&lt;br /&gt;Some people encourage initializing the singletons/static variables in the Application_Startup event, just to make sure that all the ASP.Net infrastructure.&lt;br /&gt; &lt;br /&gt;Here are some supporting links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/jeff/archive/2007/09/21/how-do-you-get-a-true-singleton-in-an-asp-net-app.aspx"&gt;http://weblogs.asp.net/jeff/archive/2007/09/21/how-do-you-get-a-true-singleton-in-an-asp-net-app.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.odetocode.com/Articles/305.aspx"&gt;http://www.odetocode.com/Articles/305.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/david.wang/archive/2005/09/01/HOWTO-Provision-ASP-dotNet-AppDomains-and-IIS6-Application-Pools.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2005/09/01/HOWTO-Provision-ASP-dotNet-AppDomains-and-IIS6-Application-Pools.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vzyl.co.za/post/2008/04/Singleton-Design-Pattern-amp3b-Lifetime-of-a-static-variable-in-ASPNET-20.aspx"&gt;http://www.vzyl.co.za/post/2008/04/Singleton-Design-Pattern-amp3b-Lifetime-of-a-static-variable-in-ASPNET-20.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.yoda.arachsys.com/csharp/singleton.html"&gt;http://www.yoda.arachsys.com/csharp/singleton.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-6407668185819487453?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/6407668185819487453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=6407668185819487453' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6407668185819487453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6407668185819487453'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2008/04/life-cycle-of-static-variables-in.html' title='Life Cycle of static variables in ASP.Net'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-3660165083568670507</id><published>2007-11-16T10:29:00.000-05:00</published><updated>2007-11-16T14:12:20.880-05:00</updated><title type='text'>BLowery Compression module and Visual Studio Webserver (Cassini)</title><content type='html'>We have been using the HTTPCompress module (BLowery), and when running your web site in development mode using the built-in web server in Visual Studio 2005 you can get the error "&lt;span style="color: rgb(0, 0, 102);font-family:verdana; font-weight:bold;"&gt;Server cannot append header after HTTP headers have been sent.&lt;/span&gt;" in cases where you want to do a Response.Flush (e.g. for downloading a file to the client).&lt;br /&gt;Now the HTTPCompress module can be configured to exclude certain pages by using the &lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;"excludedPaths" &lt;/span&gt; tag in the &lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;web.config &lt;/span&gt; file. But this did not seem to work.&lt;br /&gt;The cause was this:&lt;br /&gt;&lt;br /&gt;This is the line in the HTTPCompress Module that is supposed to chop off the absolute portion of the path:&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;&lt;br /&gt;string realPath = app.Request.Path.Remove(0, app.Request.ApplicationPath.Length+1);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This works fine if your web application is not at the root. But in the Visual Studio Development Web Server (formerly Cassini), the Request.ApplicationPath always comes back as "/". In that case the above code will actually chop off the first character of the relative path.&lt;br /&gt;I.e. &lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;"/WebResource.axd" &lt;/span&gt; will become &lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;"ebResource.axd"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The Solution: &lt;br /&gt;This is ugly, but when you do development using the Visual Studio built-in web server you need to add both paths to the web.config file.&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;&lt;br /&gt;      &amp;lt;excludedPaths&amp;gt;&lt;br /&gt;        &amp;lt;add path="ebresource.axd"/&amp;gt;&lt;br /&gt;        &amp;lt;add path="WebResource.axd"/&amp;gt;&lt;br /&gt;      &amp;lt;/excludedPaths&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Of course another option is to modify the HTTPCompress source code and fix this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-3660165083568670507?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/3660165083568670507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=3660165083568670507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3660165083568670507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3660165083568670507'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/11/blowery-compression-module-and-visual.html' title='BLowery Compression module and Visual Studio Webserver (Cassini)'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-3286072208042118354</id><published>2007-06-01T20:52:00.000-04:00</published><updated>2007-06-01T21:12:02.343-04:00</updated><title type='text'>Formatting a Column in a GridView with DataFormatString</title><content type='html'>Today I came across a little gotcha with the ASP.Net GridView control.&lt;br /&gt;If you have a bound column bound to a DateTime field and you want to change the formatting say from "05/30/2007 15:25:22" to "05/30/2007" then the way to do this is to use the DataFormatString parameter of the BoundField:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;&lt;br /&gt;&amp;lt;asp:BoundField datafield="EVENT_DATE" headertext="Event Date" DataFormatString="{0:MM/dd/yyyy}"&amp;gt;                                        &lt;br /&gt;&amp;lt;ItemStyle width="10%"&amp;gt;&amp;lt;/ItemStyle&amp;gt;&lt;br /&gt;&amp;lt;/asp:BoundField&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But this didn't seem to work for some reason. The fix is to switch off HTML encoding for the column, as explained in this &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101998"&gt;Microsoft post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So the correct code is:&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:verdana;" &gt;&lt;br /&gt;&amp;lt;asp:BoundField datafield="EVENT_DATE" headertext="Event Date" DataFormatString="{0:MM/dd/yyyy}" &lt;span style="font-weight: bold;"&gt;HtmlEncode="False"&lt;/span&gt;&amp;gt;                                        &lt;br /&gt;&amp;lt;ItemStyle width="10%"&amp;gt;&amp;lt;/ItemStyle&amp;gt;&lt;br /&gt;&amp;lt;/asp:BoundField&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now it works like a charm ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-3286072208042118354?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/3286072208042118354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=3286072208042118354' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3286072208042118354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3286072208042118354'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/06/formatting-column-in-gridview-with.html' title='Formatting a Column in a GridView with DataFormatString'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-1587736560711362952</id><published>2007-05-31T03:04:00.000-04:00</published><updated>2007-05-31T03:07:32.336-04:00</updated><title type='text'>How to enable ASP applications and ASP.Net applications on WSS</title><content type='html'>On a server running Windows Sharepoint Services (WSS) where WSS has taken over the default web site, ASP applications are disabled by default. Also, ASP.Net applications will not run by default since WSS imposes some serious security restrictions on the web site. See &lt;a href="http://support.microsoft.com/kb/828810"&gt;this MS KB article (828810)&lt;/a&gt; for details and resolution. Basically you need to set up an excluded path in the Sharepoint Services Administration page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-1587736560711362952?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/1587736560711362952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=1587736560711362952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1587736560711362952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1587736560711362952'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/05/how-to-enable-asp-applications-and.html' title='How to enable ASP applications and ASP.Net applications on WSS'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-5905485255498424325</id><published>2007-05-18T10:33:00.000-04:00</published><updated>2007-05-18T10:35:16.798-04:00</updated><title type='text'>Object-Oriented Techniques in Javascript</title><content type='html'>Here is a good MSDN article about some of the more object-oriented principles in JavaScript:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/05/javascript/default.aspx"&gt;Create Advanced Web Applications With Object-Oriented Techniques&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-5905485255498424325?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/5905485255498424325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=5905485255498424325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5905485255498424325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5905485255498424325'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/05/object-oriented-techniques-in.html' title='Object-Oriented Techniques in Javascript'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-7777283398938635017</id><published>2007-05-16T16:09:00.000-04:00</published><updated>2007-05-16T16:11:24.589-04:00</updated><title type='text'>AJAX Tips and Tricks</title><content type='html'>&lt;a href="http://www.codeproject.com/Ajax/aspnetajaxtips.asp"&gt;Here&lt;/a&gt; is an interesting article about some AJAX internals, put together by one of the co-founders of &lt;a href="http://www.pageflakes.com"&gt;PageFlakes&lt;/a&gt;. Interesting is especially the part on caching web service responses (if appropriate in your case).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-7777283398938635017?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/7777283398938635017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=7777283398938635017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7777283398938635017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7777283398938635017'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/05/ajax-tips-and-tricks.html' title='AJAX Tips and Tricks'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-4046433927409130865</id><published>2007-05-14T12:53:00.000-04:00</published><updated>2007-05-14T13:08:39.527-04:00</updated><title type='text'>Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined</title><content type='html'>Just ran into this weird error when trying to add an AJAX control to a web page and we spent a lot of time trying to resolve this.&lt;br /&gt;Basically the web page worked fine but when moving it to the server it generated a client-side JS error: "Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined".&lt;br /&gt;&lt;br /&gt;this is the corresponding code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; Sys.Application.add_init(function() {&lt;br /&gt;$create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground", ...}, null, null, $get("btnNew"));&lt;br /&gt;});&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Google search did reveal people having similar problems but no good solution.&lt;br /&gt;Then there was some good information in &lt;a href="http://forums.asp.net/7/1446560/ShowThread.aspx"&gt;this thread&lt;/a&gt;.&lt;br /&gt;Basically it turns out that the the script is being compressed under certain circumstances (like debug mode vs. non-debug) and whether the compression settings are defined in the web.config file.&lt;br /&gt;&lt;br /&gt;Here is what fixed it for us. The important setting is the one &lt;span style="font-weight: bold;"&gt;"enableCompression='false'"&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&amp;lt;system.web.extensions&amp;gt;&lt;br /&gt;   &amp;lt;scripting&amp;gt;&lt;br /&gt;     &amp;lt;scriptresourcehandler enablecompression="false" enablecaching="true"&amp;gt;&lt;br /&gt;   &amp;lt;/scriptresourcehandler&amp;gt;&lt;br /&gt; &amp;lt;/scripting&amp;gt;&lt;br /&gt;&amp;lt;/system.web.extensions&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Make sure you switch the compression off, since it seems it does not work, even when using IE7 like I do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-4046433927409130865?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/4046433927409130865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=4046433927409130865' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4046433927409130865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4046433927409130865'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/05/microsoft-jscript-runtime-error.html' title='Microsoft JScript runtime error: &apos;AjaxControlToolkit&apos; is undefined'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-982460513317115599</id><published>2007-04-23T01:12:00.000-04:00</published><updated>2007-04-23T01:26:34.455-04:00</updated><title type='text'>Winforms Tabbed UI using multiple forms</title><content type='html'>The problem at hand was how to create a Windows Forms application that uses a tabbed UI, but where you want to put the logic into separate forms, i.e. each tab page is a separate WinForm (this is mainly to not have all the code and controls in the main page).&lt;br /&gt;&lt;br /&gt;I found 3 main approaches to this (there are probably more, but these accomplish the stated goal without excessive coding):&lt;br /&gt;&lt;br /&gt;1. the &lt;a href="http://www.cflashsoft.com/progs/mdiwinman/"&gt;MDIWindowManager&lt;/a&gt; project (free under BSD license)&lt;br /&gt;&lt;br /&gt;2. the &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=110642"&gt;DockPanel Suite&lt;/a&gt; project (free, from SourceForge)&lt;br /&gt;&lt;br /&gt;3. do-it-yourself (VB.Net code)&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;    Private Sub AddFormToTab(ByVal objForm As Form, ByRef objTabPage As TabPage)&lt;br /&gt;        objForm.TopLevel = False&lt;br /&gt;        objForm.Text = ""&lt;br /&gt;        objForm.MaximizeBox = False&lt;br /&gt;        objForm.MinimizeBox = False&lt;br /&gt;        objForm.ControlBox = False&lt;br /&gt;        objTabPage.Controls.Add(objForm)&lt;br /&gt;        objForm.Dock = DockStyle.Fill ' Expands the form to fill the tabpage&lt;br /&gt;        objForm.Show()&lt;br /&gt;    End Sub&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Use this method in the main form to add a form to a tab page.&lt;br /&gt;The do-it-yourself method is simple and works, the other 2 links with the accompanying source code provide more functionality.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-982460513317115599?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/982460513317115599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=982460513317115599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/982460513317115599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/982460513317115599'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/04/winforms-tabbed-ui-using-multiple-forms.html' title='Winforms Tabbed UI using multiple forms'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-4431461433144353231</id><published>2007-04-17T23:36:00.001-04:00</published><updated>2007-04-19T14:54:46.120-04:00</updated><title type='text'>Everyone's talking about RIAs now...</title><content type='html'>It seems to me that the current hot acronym is RIA (Rich Internet Applications). I first read about it on Adobe's website when reading about Adobe Apollo (see my post on this).  Now &lt;a href="http://www.west-wind.com/WebLog/default.aspx"&gt;Rick Strahl&lt;/a&gt; has published a &lt;a href="http://www.west-wind.com/weblog/posts/50649.aspx"&gt;very good post&lt;/a&gt; about the trends we're seeing in the end user application development space. He does a great job putting things like WPF, WPF/E, Adobe Flex/Apollo, HTML/AJAX in perspective. As I said before, something is going on there that every serious developer needs to keep an eye out for... &lt;br /&gt;I like one of the comments to his post (and pretty much mirrors my experiences): &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"Another great read Rick. I have to admit that the last two big projects that I was on both were vb6 -&gt; asp.net/ajax conversions and BOTH got halfway through development and were re-architected for clickonce and wpf because ajax still doesn't allow you to throw 30 infragistics web combos on a page. Some presentation layers just don't work well with html and probably never will granted time and a hardware refresh might change that.&lt;br /&gt;When there's a preexisting expectation of the thick client experience, even ajax doesn't cut it. I'd like to see more of this clear separation of layers. The asp.net code behind model doesn't give you the ability to cut with clean lines where ui starts and the last layer stopped. throwing cab and things like ioc into the picture just complicate things. I'm all for the service model. I think Flash is there but they never got it right for the developer. It wasn't until flex builder that they released something with intellisense. Flex is nice but it just adds more overhead and is an abstraction for people who aren't core coders. ..."&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-4431461433144353231?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/4431461433144353231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=4431461433144353231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4431461433144353231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/4431461433144353231'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/04/everyones-talking-about-rias-now_17.html' title='Everyone&apos;s talking about RIAs now...'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-2091170240008431861</id><published>2007-04-10T11:13:00.000-04:00</published><updated>2007-04-10T11:15:56.035-04:00</updated><title type='text'>SQL Server BLOB datatypes going away</title><content type='html'>This is something to be aware of:&lt;br /&gt;It looks like the SQL Server datatypes TEXT, NTEXT, IMAGE are going away sometime in the future as noted in SQL server Books online: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms187993.aspx"&gt;"ntext, text, and image (Transact-SQL)"&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;So for any new tables that need to store large data fields, M$ is suggesting to use VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-2091170240008431861?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/2091170240008431861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=2091170240008431861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2091170240008431861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2091170240008431861'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/04/sql-server-blob-datatypes-going-away.html' title='SQL Server BLOB datatypes going away'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-560864048611900039</id><published>2007-04-05T04:06:00.000-04:00</published><updated>2007-04-05T04:23:09.453-04:00</updated><title type='text'>Adobe Apollo</title><content type='html'>A colleague of mine pointed out &lt;a href="http://labs.adobe.com/technologies/apollo"&gt;Adobe Apollo&lt;/a&gt; to me.&lt;br /&gt;This is a very interesting technology and just confirms the trends that seem to be crystallizing in the application development space.&lt;br /&gt;- pure web applications are reaching their limits in terms of usability&lt;br /&gt; -&gt; Web 2.0 wants to address that with AJAX, but the underlying protocols/languages (HTML) are just too old &lt;br /&gt;- the large deployment of existing browsers, different browser technologies and the  security implications that lead to tighter browser security limit what can be delivered to the user even using Web 2.0&lt;br /&gt;- the user wants a seamless experience with applications that are powerful and allow desktop access and disconnected operation&lt;br /&gt;&lt;br /&gt;-&gt; It seems that the major players in this field are realizing this and the solution offered is a completely new "browser" - a new runtime to host new and improved content and make it feel more like a desktop application (speed, access to local file system and apps, disconnected operation)&lt;br /&gt;- Microsoft introduced WPF/E as a new runtime to run XAML applications&lt;br /&gt;- Adobe is working on Apollo (synergy between Flash, PDF, HTML, JavaScript, Ajax according to their web site)&lt;br /&gt;&lt;br /&gt;On a related note, Microsoft's Click-Once technologies try to address the deployment and maintenance problems that plague desktop applications.&lt;br /&gt;&lt;br /&gt;So basically the convergence of these technologies is targeted to the enhanced user experience. The user wants the best of both worlds:&lt;br /&gt; - web app's ease of deployment, always up-to-date, highly portable&lt;br /&gt; - desktop app's speed, UI features, disconnected mode, access to local system resources &lt;br /&gt;&lt;br /&gt;We'll have to see how this pans out, but this is definitely something that seems to be here to stay and I think we haven't seen the last of this.&lt;br /&gt;Especially if Adobe manages to create their Apollo runtime for the Windows Mobile and  Linux platforms (and maybe Symbian/PalmOS devices) this might be a technology that can catch on.&lt;br /&gt;&lt;br /&gt;But in general, for me as a developers this means to be aware of this trend and keep up with the technologies involved&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-560864048611900039?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/560864048611900039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=560864048611900039' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/560864048611900039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/560864048611900039'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/04/adobe-apollo.html' title='Adobe Apollo'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-3469410707020329925</id><published>2007-04-05T04:02:00.000-04:00</published><updated>2007-04-05T04:05:42.401-04:00</updated><title type='text'>ASP.Net Cache clarifications</title><content type='html'>Tess from MSDN has a very good post on some common ASP.Net Cache pitfalls and misconceptions &lt;a href="http://blogs.msdn.com/tess/archive/2006/08/22/695268.aspx"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-3469410707020329925?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/3469410707020329925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=3469410707020329925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3469410707020329925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3469410707020329925'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/04/aspnet-cache-clarifications.html' title='ASP.Net Cache clarifications'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-2457065528426228107</id><published>2007-03-04T15:26:00.000-05:00</published><updated>2007-03-04T15:29:57.524-05:00</updated><title type='text'>Yahoo Pipes</title><content type='html'>This seems very interesting. &lt;br /&gt;[&lt;a href="http://pipes.yahoo.com/"&gt;Yahoo! Pipes&lt;/a&gt;] &lt;span style="font-style:italic;"&gt;Pipes is a free online service that lets you remix popular feed types and create data mashups using a visual editor. You can use Pipes to run your own web projects, or publish and share your own web services without ever having to write a line of code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is an interesting application concept just launched by Yahoo.&lt;br /&gt;Still trying to get a handle on the possibler implications and the types of applications you can build with this, but it seem like a very powerful concept for business intelligence/data mining type of things and to combat the "information overload". More information here on &lt;a href="http://www.techcrunch.com/2007/02/07/yahoo-launches-pipes/"&gt;TechCrunch&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-2457065528426228107?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/2457065528426228107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=2457065528426228107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2457065528426228107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2457065528426228107'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/03/yahoo-pipes.html' title='Yahoo Pipes'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-5783958685949680672</id><published>2007-03-04T15:25:00.000-05:00</published><updated>2007-03-04T15:26:08.946-05:00</updated><title type='text'>Back from vacation</title><content type='html'>Alright, back to work after a week in Jackson Hole, skiing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-5783958685949680672?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/5783958685949680672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=5783958685949680672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5783958685949680672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/5783958685949680672'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/03/back-from-vacation.html' title='Back from vacation'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-2968249989973109407</id><published>2007-02-19T18:58:00.001-05:00</published><updated>2010-10-25T15:31:48.428-04:00</updated><title type='text'>Copy data between 2 SQL servers</title><content type='html'>Using the BCP utility that comes with SQL Server 2000/2005 you can quickly export data from one SQL server installation and import it into another. This is described on &lt;a href="http://msdn2.microsoft.com/en-US/library/ms191232.aspx"&gt;MSDN&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The tricky thing is to get the command line parameters right, you need to specify the -S argument if you have multiple or named instances of SQL server installed.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example:&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;bcp Northwind.dbo.Authors out C:\Temp\DataExport.dat -n -T -S MPDESKTOP\SQL2005&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Otherwise you will get stupid errors such as: "NativeError = 18456 .... Login failed for user xxxx" ...&lt;br /&gt;&lt;br /&gt;Then the import is pretty simple, you can use Query Analyzer (or SQL server Management Studio) to run this query:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;USE Northwind&lt;br /&gt;GO&lt;br /&gt;BULK INSERT Authors &lt;br /&gt;    FROM 'G:\Transfer\Tempfiles\DataExport.dat' &lt;br /&gt;   WITH (DATAFILETYPE='native'); &lt;br /&gt;GO&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-2968249989973109407?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/2968249989973109407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=2968249989973109407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2968249989973109407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2968249989973109407'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/copy-data-between-2-sql-servers.html' title='Copy data between 2 SQL servers'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-3836099237985103085</id><published>2007-02-16T10:25:00.000-05:00</published><updated>2007-02-16T10:35:06.792-05:00</updated><title type='text'>Class Logging and tracing - approach using custom attributes</title><content type='html'>If, for debugging purposes, you want to see what is going on in your .Net code, one approach would be to add something like&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Log.Debug("FindCustomers -&gt; enter method")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Into each method you are interested in.&lt;br /&gt;Another, more generic and actually pretty cool approach would be to "instrument" your classes using custom attributes.&lt;br /&gt;A sample approach is shown &lt;a href="http://geekswithblogs.net/shahedul/archive/2007/02/07/105664.aspx"&gt;here&lt;/a&gt;. (Overlook the repeated and dorky use of the term "spy" :) ).&lt;br /&gt;&lt;br /&gt;The drawback is that using the above approach, your classes would have to inherit from a common base class ... but maybe there is a way around that and just use the attribute ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-3836099237985103085?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/3836099237985103085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=3836099237985103085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3836099237985103085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/3836099237985103085'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/class-logging-and-tracing-approach.html' title='Class Logging and tracing - approach using custom attributes'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-8013560897106866427</id><published>2007-02-16T10:11:00.000-05:00</published><updated>2007-02-16T10:38:29.614-05:00</updated><title type='text'>SQL Server Performance Analysis and Tuning</title><content type='html'>Came across an interesting post today about using SQL Profiler to analyze performance issues in SQL Server. More can be found &lt;a href="http://vyaskn.tripod.com/analyzing_profiler_output.htm"&gt;here&lt;/a&gt;.&lt;br /&gt;Basically the author provides a custom SQL Profiler template and then a set of stored procs to analyze the output of the captured data for long-running stored procs and most cpu-intensive stored procs etc.&lt;br /&gt;&lt;br /&gt;Incidentally, the author (Vyas) has a pretty good &lt;a href="http://vyaskn.tripod.com/index.htm"&gt;web site&lt;/a&gt; for everything SQL Server related.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-8013560897106866427?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/8013560897106866427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=8013560897106866427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8013560897106866427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8013560897106866427'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/sql-server-performance-analisys-and.html' title='SQL Server Performance Analysis and Tuning'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-7041920395469174749</id><published>2007-02-15T18:18:00.000-05:00</published><updated>2007-02-15T18:24:23.033-05:00</updated><title type='text'>HTTP Streaming - interesting alternative to polling</title><content type='html'>Triggered by a question that came up about how to create a web page that shows data dynamically without user interaction (like a stock ticker, weather conditions etc.), I came across this &lt;a href="http://softwareas.com/http-streaming-an-alternative-to-polling-the-server"&gt;post that&lt;/a&gt; explains HTTP Streaming.&lt;br /&gt;The obvious answer would be to do "polling" having some Javascript timer on the page that makes a periodic XMLHTTPRequest to get data back to the page.&lt;br /&gt;HTTP Streaming is an interesting alternative.&lt;br /&gt;It is also interesting that apparently IE does not send the response to an XMLHTTPRequest back unless the request is complete, so the article also describes a clever way around that.&lt;br /&gt;The main drawbacks I can see are bandwidth and the required resources on the server, basically one open connection (or thread) per connected client.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-7041920395469174749?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/7041920395469174749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=7041920395469174749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7041920395469174749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7041920395469174749'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/http-streaming-interesting-alternative.html' title='HTTP Streaming - interesting alternative to polling'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-2201292457372405982</id><published>2007-02-09T09:36:00.000-05:00</published><updated>2007-02-09T09:41:33.404-05:00</updated><title type='text'>VS2005 SP1 - bloat in the Solution (.sln) file</title><content type='html'>Just ran across this, when adding a new file to a Visual Studio 2005 solution, now the solution gets all these additional entries for each project:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;ProjectSection(WebsiteProperties) = preProject&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Debug.AspNetCompiler.Debug = "True"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;   Release.AspNetCompiler.Debug = "False"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;EndProjectSection&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;And these are not even web site projects, just regular DLLs (Class Library) projects used from a Web Application Project (WAP).&lt;br /&gt;&lt;br /&gt;What is going on? Looks like this was a "feature" introduced with SP1. At least I am &lt;a href="http://extraview.co.uk/blog/PermaLink,guid,4c044e14-a234-473a-9bd9-ecfb43daef23.aspx"&gt;not the only one&lt;/a&gt; seeing this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Call me old fashioned, but I don't like it ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-2201292457372405982?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/2201292457372405982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=2201292457372405982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2201292457372405982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/2201292457372405982'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/vs2005-sp1-bloat-in-solution-sln-file.html' title='VS2005 SP1 - bloat in the Solution (.sln) file'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-7329034991115697330</id><published>2007-02-07T20:33:00.000-05:00</published><updated>2007-02-07T20:42:06.601-05:00</updated><title type='text'>To NOCOUNT or not to NOCOUNT .. that is the question</title><content type='html'>Well, there has been an ongoing debate whether it is good practice to use "SET NOCOUNT ON" in SQL Server to reduce the network traffic.&lt;br /&gt;&lt;br /&gt;I think if you are running UPDATE and DELETE statements or stored procedures where you don't expect any results back or have output parameters that contain the outcome of the stored procedure, it probably makes sense to include it.&lt;br /&gt;&lt;br /&gt;There's a post by &lt;a href="http://weblogs.asp.net/jgalloway/archive/2006/08/30/How-NOCOUNT-affects-ADO.NET.aspx"&gt;Jon Galloway&lt;/a&gt; that looks at this as well and argues that the RecordsAffected is hardly used anymore in ADO.net and with SqlDataReaders.&lt;br /&gt;So the bottom line is: use SET NOCOUNT ON if you don't need to have the RecordsAffected as part of your business logic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-7329034991115697330?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/7329034991115697330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=7329034991115697330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7329034991115697330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7329034991115697330'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/to-nocount-or-not-to-nocount-that-is.html' title='To NOCOUNT or not to NOCOUNT .. that is the question'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-7519930174504930961</id><published>2007-02-06T11:52:00.000-05:00</published><updated>2007-02-06T12:05:07.298-05:00</updated><title type='text'>ASP.Net Cache - cached items disappearing</title><content type='html'>Sometimes when working on my local machine, items that I put into the ASP.Net Cache would just seem to disappear immediately from the Cache, defeating the purpose of caching. When hooking in the "&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.caching.cacheitemremovedcallback%28VS.80%29.aspx"&gt;CacheItemRemovedCallBack&lt;/a&gt;" in the add method, the reason the items were removed from the Cache was "underused".&lt;br /&gt;Basically I was running into the same issue described &lt;a href="http://blogs.msdn.com/praveeny/archive/2006/12/11/asp-net-2-0-cache-objects-get-trimmed-when-you-have-low-available-memory.aspx"&gt;here&lt;/a&gt;. It seems like the Cache was working as expected, it just "thought" that I had not enough memory left to cache any items.&lt;br /&gt;&lt;br /&gt;One solution that was suggested on the web is to "disableMemoryCollection" for the cache as described &lt;a href="http://www.johnsadventures.com/archives/2006/02/why_does_my_aspnet_cache_keep_clearing_i.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think that would be acceptable on a developer's machine for debugging, but not for a production server, because again, letting the Cache manage it's own memory seems the better approach here.&lt;br /&gt;The other option is to add the items to the Cache with a "notRemovable" priority. That also seems like asking for trouble, because then ASP.Net is forced to keep stuff in the Cache even if that memory was better used for serving a spike in user requests for instance.&lt;br /&gt;&lt;br /&gt;There are a few settings that control the ASP.Net Cache's policies on reclaiming space and purging items settings: &lt;a href="http://forums.asp.net/thread/1199949.aspx"&gt;http://forums.asp.net/thread/1199949.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-7519930174504930961?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/7519930174504930961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=7519930174504930961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7519930174504930961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/7519930174504930961'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/aspnet-cache-cached-items-disappearing.html' title='ASP.Net Cache - cached items disappearing'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-8509347636292637227</id><published>2007-02-03T16:30:00.000-05:00</published><updated>2007-02-03T16:38:04.846-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web services'/><title type='text'>In search of: Extensible web service framework</title><content type='html'>I am looking for a good approach to create a web service that is pretty generic and can be extended. Requirements:&lt;br /&gt;- easy to add new functionality&lt;br /&gt;- multiple clients can hit this web service, clients can be on different software versions, new available functionality should not break older clients.&lt;br /&gt;&lt;br /&gt;I found this interesting article "&lt;a href="http://www.codeproject.com/soap/xydatasetservice.asp"&gt;A web service as a framework for simplifying development and deployment of business functions&lt;/a&gt;". Somewhat against the "true" tenets of designing web service contracts etc., but might fit the bill for what I need.&lt;br /&gt;The input and output parameters of this generic web service are typed datasets, and the business assemblies are loaded using reflection based in a service name given in th request.&lt;br /&gt;The disadvantage is that the functionality is not explicitly described in the web service contract, it needs to be implicitly known by the client and the server (business logic assembly) based on the service name passed in. This keeps the web service interface constant when new functionality needs to be added (versioning is not a problem this way).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-8509347636292637227?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/8509347636292637227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=8509347636292637227' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8509347636292637227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/8509347636292637227'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/in-search-of-exetnsible-web-service.html' title='In search of: Extensible web service framework'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-1556562951781505693</id><published>2007-02-02T23:12:00.000-05:00</published><updated>2007-02-02T23:36:54.916-05:00</updated><title type='text'>Insufficient system resources exist ... what's going on?</title><content type='html'>So finally today I got my new &lt;a href="http://www.seagate.com/www/en-us/products/desktops/barracuda_hard_drives/barracuda_7200.10"&gt;Seagate Barracuda 320 GB&lt;/a&gt; hard drive, put it into a USB 2.0 enclosure  and started copying files (I mean thousands of files) onto it. After a while I get the following error "Insufficient system resources exist to complete the requested service." I am running Windows XP Pro, SP2.&lt;br /&gt;Great.... just what I need...&lt;br /&gt;Bad drive?&lt;br /&gt;USB enclosure bad?&lt;br /&gt;So I did some searching, increased my page file size, turned off any background programs, reboot, reboot .. no avail.&lt;br /&gt;I finally found this article by Microsoft &lt;a href="http://support.microsoft.com/kb/304101"&gt;"&lt;/a&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://support.microsoft.com/kb/304101"&gt;Backup program is unsuccessful when you back up a large system volume"&lt;/a&gt; ... I applied the first registry change (PoolUsageMaximum) with a setting of 60 and that did the trick!&lt;br /&gt;I mean how on earth are you supposed to know that there is some system internal kernel memory limit of 160 MB?  Well well ... seems to be working fine now.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-1556562951781505693?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/1556562951781505693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=1556562951781505693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1556562951781505693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/1556562951781505693'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/insufficient-system-resources-exist.html' title='Insufficient system resources exist ... what&apos;s going on?'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-949060813444146008.post-6166023850908248466</id><published>2007-02-02T23:02:00.000-05:00</published><updated>2007-02-02T23:06:11.848-05:00</updated><title type='text'>Hello Blog</title><content type='html'>Hi there,&lt;br /&gt;I am actually creating this blog to keep stuff around that I think I might want to look up later on again.&lt;br /&gt;Well, and maybe something in here will be useful for someone else ...&lt;br /&gt;&lt;br /&gt;On that note, let's get started ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/949060813444146008-6166023850908248466?l=midnight-coder.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://midnight-coder.blogspot.com/feeds/6166023850908248466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=949060813444146008&amp;postID=6166023850908248466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6166023850908248466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/949060813444146008/posts/default/6166023850908248466'/><link rel='alternate' type='text/html' href='http://midnight-coder.blogspot.com/2007/02/hello-blog.html' title='Hello Blog'/><author><name>Michael</name><uri>http://www.blogger.com/profile/03788510282468570998</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
