<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>DM idea</title>
	<atom:link href="http://dmidea.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmidea.wordpress.com</link>
	<description>DM stands for Donut &#38; Muffin, my two cutie dogs.</description>
	<lastBuildDate>Fri, 05 Feb 2010 01:26:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dmidea.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>DM idea</title>
		<link>http://dmidea.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dmidea.wordpress.com/osd.xml" title="DM idea" />
	<atom:link rel='hub' href='http://dmidea.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JQuery validation Example</title>
		<link>http://dmidea.wordpress.com/2010/02/05/jquery-validation-example/</link>
		<comments>http://dmidea.wordpress.com/2010/02/05/jquery-validation-example/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 01:26:45 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[dropdownlist]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[radiobutton]]></category>
		<category><![CDATA[radiobuttonlist]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=136</guid>
		<description><![CDATA[Hi all, I have recently worked on some client-side validation for dynamic generated UI by ASP.Net. As usual, I started to spend some time to write a small htm page for prototype and testing. &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; &#62; &#60;head&#62;&#60;title&#62; &#60;/title&#62;&#60;link href=&#34;./main.css&#34; type=&#34;text/css&#34; rel=&#34;stylesheet&#34; /&#62;&#60;link href=&#34;./globalClasses.css&#34; type=&#34;text/css&#34; rel=&#34;stylesheet&#34; /&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=136&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>I have recently worked on some client-side validation for dynamic generated UI by ASP.Net.  As usual, I started to spend some time to write a small htm page for prototype and testing.</p>
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;&lt;title&gt;

&lt;/title&gt;&lt;link href=&quot;./main.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;&lt;link href=&quot;./globalClasses.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;
    &lt;script src=&quot;./jquery-1.3.2.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;./jquery.validate.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form name=&quot;ctl01&quot; method=&quot;post&quot; id=&quot;ctl01&quot;&gt;

	&lt;div id=&quot;Ctl0_QuestionList&quot;&gt;
		&lt;input name=&quot;Ctl0_QuestionLlistError&quot; type=&quot;hidden&quot; /&gt;
		&lt;div id=&quot;textboxContainerPanel&quot;&gt;
			&lt;div id=&quot;textBoxPanel&quot;&gt;
				&lt;input name=&quot;Ctl0_TextBox1&quot; type=&quot;text&quot; id=&quot;Ctl0_TextBox1&quot;/&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;br /&gt;
		&lt;select name=&quot;Ctl0_DropDownList1&quot; id=&quot;Ctl0_DropDownList1&quot;&gt;
			&lt;option value=&quot;&quot;&gt;&lt;/option&gt;
			&lt;option value=&quot;BMW&quot;&gt;BMW&lt;/option&gt;
			&lt;option value=&quot;Honda&quot;&gt;Honda&lt;/option&gt;
			&lt;option value=&quot;Toyota&quot;&gt;Toyota&lt;/option&gt;
		&lt;/select&gt;
		&lt;br /&gt;
		&lt;div id=&quot;radioContainerPanel&quot;&gt;
			&lt;div id=&quot;radiobuttonpanel&quot;&gt;
				&lt;input id=&quot;Ctl0_RadioButtonList1_0&quot; type=&quot;radio&quot; name=&quot;Ctl0_RadioButtonList1&quot; value=&quot;Milk&quot; /&gt;&lt;label for=&quot;Ctl0_RadioButtonList1_0&quot;&gt;Milk&lt;/label&gt;
				&lt;br /&gt;
				&lt;input id=&quot;Ctl0_RadioButtonList1_1&quot; type=&quot;radio&quot; name=&quot;Ctl0_RadioButtonList1&quot; value=&quot;Apple&quot; /&gt;&lt;label for=&quot;Ctl0_RadioButtonList1_1&quot;&gt;Apple&lt;/label&gt;
				&lt;br /&gt;
				&lt;input id=&quot;Ctl0_RadioButtonList1_2&quot; type=&quot;radio&quot; name=&quot;Ctl0_RadioButtonList1&quot; value=&quot;Cheese&quot; /&gt;&lt;label for=&quot;Ctl0_RadioButtonList1_2&quot;&gt;Cheese&lt;/label&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;br /&gt;
    &lt;input type=&quot;submit&quot; name=&quot;Ctl0_Button1&quot; value=&quot;Button&quot; id=&quot;Ctl0_Button1&quot; type=&quot;submit&quot; class=&quot;submit&quot; onclick=&quot;printValue();&quot;/&gt;

&lt;script type=&quot;text/javascript&quot;&gt;

function printValue()
{
	var answeredCount = 0;
	var tag = 'test';

	$(&quot;[id$='QuestionList'] input[type='text']&quot;).each ( function (index) {
		if ($(this).val() != &quot;&quot;) answeredCount += 1;
	});

	$(&quot;[id$='QuestionList'] select&quot;).each( function (index) {
		if ($(this).val() != &quot;&quot;) answeredCount += 1;
	});

	answeredCount += $(&quot;[id$='QuestionList'] input[type='radio']:checked&quot;).size();

	alert(tag + &quot;:&quot; + answeredCount);
}

//&lt;![CDATA[
$(document).ready(function() {
	$('#ctl01').validate(
		{
			errorPlacement: function (error, element)
			{
				if (element.attr('type') == 'radio')
				{
					error.insertAfter(element.parent());
				}
				else
				{
					error.insertAfter(element);
				}
			}
		}
	);
	$(&quot;[name$='TextBox1']&quot;).rules('add',
	{
		required: true,
		messages:
		{
			required: 'please enter TextBox1.'
		}
	});
	$(&quot;[name$='DropDownList1']&quot;).rules('add',
	{
		required: true,
		messages:
		{
			required: 'please enter DropDownList1.'
		}
	});
	$(&quot;[name$='RadioButtonList1']&quot;).rules('add',
	{
		required: true,
		messages:
		{
			required: 'please enter RadioButtonList1.'
		}
	});
	$(&quot;[name$='QuestionLlistError']&quot;).rules('add',
	{
		required: function(element) {
			var requiredCount = 2;
			var answeredCount = 0;

			$(&quot;[id$='QuestionList'] input[type='text']&quot;).each ( function (index) {
				if ($(this).val() != &quot;&quot;) answeredCount += 1;
			});

			$(&quot;[id$='QuestionList'] select&quot;).each( function (index) {
				if ($(this).val() != &quot;&quot;) answeredCount += 1;
			});

			answeredCount += $(&quot;[id$='QuestionList'] input[type='radio']:checked&quot;).size();

			return (requiredCount &gt; answeredCount);
		},
		messages:
		{
			required: 'please enter QuestionList1.'
		}
	});
});//]]&gt;
&lt;/script&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Above is the small htm page of my work.  Please spend some time play with it and you will find it is very useful (I believe) for:<br />
1. Change the error message for radio button.<br />
2. Dynamic validation for requried question count/response count.</p>
<p>Enjoy!!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=136&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2010/02/05/jquery-validation-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>Asp.Net Mvc Theme and Globalization Support</title>
		<link>http://dmidea.wordpress.com/2009/09/27/asp-net-mvc-theme-and-globalization-support/</link>
		<comments>http://dmidea.wordpress.com/2009/09/27/asp-net-mvc-theme-and-globalization-support/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 23:52:38 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=132</guid>
		<description><![CDATA[I am very interested to use ASP.Net Mvc framework and read many of related articles. However I haven&#8217;t found a flexible theme and globalization supporting solution with sample codes. Therefore, I would like to build this to provide everyone as a starting point to customize their own solution. You can download the sample solution from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=132&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am very interested to use ASP.Net Mvc framework and read many of related articles. However I haven&#8217;t found a flexible theme and globalization supporting solution with sample codes. Therefore, I would like to build this to provide everyone as a starting point to customize their own solution.</p>
<p>You can download the sample solution from <a class="wpGallery" title="MvcTheme Solution" href="http://www.4shared.com/file/135877808/dc452359/MvcThemeSln.html" target="_blank">here</a>.</p>
<p>This solution, I have implemented a new ResourceProviderFactory to customize the corresponding theme and define the resource file mapping; and also a new view engine in order to support different implementations for different themes.   In the solution, I have used FluentHtml from MvcContrib and MVC T4 templates.  To remind, this is just a starting point, there are lots of enhancement you can make such as helpers to access resource stings.  You are welcome to share your feedback when using this and/or any enhancemets you have made on it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=132&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2009/09/27/asp-net-mvc-theme-and-globalization-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>Linq to XSD: cannot reference the namespace</title>
		<link>http://dmidea.wordpress.com/2009/06/14/linq-to-xsd-cannot-reference-the-namespace/</link>
		<comments>http://dmidea.wordpress.com/2009/06/14/linq-to-xsd-cannot-reference-the-namespace/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 23:02:16 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[Linq to XSD]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=124</guid>
		<description><![CDATA[I have recently install LinqtoXSD coz I would like to write some text on IQueryable objects which require some test data.  After I have installed LinqtoXSD, then I follow the sample found in http://www.codeproject.com/KB/linq/LINQ_to_XSD.aspx.  I have rebuild the whole solution after adding the XSD schema file.   However Resharper complain that the namespace I have defined [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=124&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have recently install LinqtoXSD coz I would like to write some text on IQueryable objects which require some test data.  After I have installed LinqtoXSD, then I follow the sample found in <a href="http://www.codeproject.com/KB/linq/LINQ_to_XSD.aspx">http://www.codeproject.com/KB/linq/LINQ_to_XSD.aspx</a>.  I have rebuild the whole solution after adding the XSD schema file.   However Resharper complain that the namespace I have defined in XSD doesn&#8217;t exist.  I have opened the object browser and check that the namespace do exist.</p>
<p>I don&#8217;t know what I did wrongly, then I have downloaded the demo source from above link and do a diff on the related project and solution files, but there is no findings. </p>
<p>Finally I close and re-open the solution, then the namespace is displayed by intellisence and resharper no longer to complain it.</p>
<p>P.S.&gt; I am using VS 2008 SP1.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=124&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2009/06/14/linq-to-xsd-cannot-reference-the-namespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>Install loopback network adapter in Vista host to connect virtual machine</title>
		<link>http://dmidea.wordpress.com/2009/04/23/install-loopback-network-adapter-in-vista-host-to-connect-virtual-machine/</link>
		<comments>http://dmidea.wordpress.com/2009/04/23/install-loopback-network-adapter-in-vista-host-to-connect-virtual-machine/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 05:27:36 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[loopback network adapter]]></category>
		<category><![CDATA[Virtual machine]]></category>
		<category><![CDATA[virtual PC]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=120</guid>
		<description><![CDATA[Hello, I am very busy to setup my new house in last month. After that, I also upgrade my XP to vista and plan to run a Windows 2008 virtual machine. Therefore I try to setup a loopback network adapter to connect between vista host and virtual machine running on Virtual PC 2007. Initially I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=120&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>I am very busy to setup my new house in last month. After that, I also upgrade my XP to vista and plan to run a Windows 2008 virtual machine. Therefore I try to setup a loopback network adapter to connect between vista host and virtual machine running on Virtual PC 2007. Initially I think this is a 5-minutes task, and you can easily find information / steps from the internet teaching you how to do this. However after reading thr&#8217; the internet, I cannot find the correct steps to setup loopback adapter with virtual PC.</p>
<p>I find a web site that just have a little problem with the setup procedures:<br />
<a href="http://weblogs.asp.net/bsimser/archive/2009/04/20/using-the-loopback-adapter-and-sharepoint.aspx">http://weblogs.asp.net/bsimser/archive/2009/04/20/using-the-loopback-adapter-and-sharepoint.aspx</a></p>
<p>Here are the high-level steps:</p>
<ol>
<li> install loopback network adapter in host machine (vista)</li>
<li>configure static ip  (say 192.168.0.1 with subnet 255.255.255.0) to loopback network adapter</li>
<li>assign the loopback network adapter ONLY to virtual machine (win2008) networking setting.</li>
<li>start virtual machine</li>
<li>go to network connection in virtual machine, you can find there is a network adapter here.</li>
<li>then configure this network adapter with static ip (say 192.168.0.100 with subnet 255.255.255.0)</li>
<li>then try to ping 192.168.0.1 from virtual machine.</li>
<li>If you want to use the computer name to ping each other, you can open windows\system32\drivers\etc\host file and add the corresponding entry; do this for both host and virtual machine.</li>
</ol>
<p>Now my vista (host) can talk to win 2008 (virtual machine) each other.   Wish this can help you setup your network in 5 minutes&#8230;(i used 2 hours to make this work).  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=120&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2009/04/23/install-loopback-network-adapter-in-vista-host-to-connect-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>SharpZipLib Example</title>
		<link>http://dmidea.wordpress.com/2009/01/06/sharpziplib-example/</link>
		<comments>http://dmidea.wordpress.com/2009/01/06/sharpziplib-example/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 19:45:06 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[ISharpCode]]></category>
		<category><![CDATA[SharpZipLib]]></category>
		<category><![CDATA[Unzip]]></category>
		<category><![CDATA[Zip]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=110</guid>
		<description><![CDATA[Hello everyone, i recently need to unzip the downloaded data files. As a result, I find that there is a useful library provided by ISharpCode with sample code in Peter Bromberg&#8217;s blog.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=110&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, i recently need to unzip the downloaded data files. As a result, I find that there is a useful library provided by ISharpCode with sample code in <a href="http://www.eggheadcafe.com/tutorials/aspnet/9ce6c242-c14c-4969-9251-af95e4cf320f/zip--unzip-folders-and-f.aspx">Peter Bromberg&#8217;s blog</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=110&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2009/01/06/sharpziplib-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>Compute MD5 checksum in hex string</title>
		<link>http://dmidea.wordpress.com/2009/01/02/compute-md5-checksum-in-hex-string/</link>
		<comments>http://dmidea.wordpress.com/2009/01/02/compute-md5-checksum-in-hex-string/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 17:34:52 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[hex string]]></category>
		<category><![CDATA[md5]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=101</guid>
		<description><![CDATA[Recently I need to validate the checksum of the downloaded data file.  After looking around, I find this reference to teach you how to compute the MD5 hash, http://www.nikhedonia.com/notebook/entry/verifying-md5-checksum/.  However i found that the MD5 hash in the checksum file stores as 32-characters, which is different from 16-bytes MD5 hash.  Finally I knew that this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=101&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I need to validate the checksum of the downloaded data file.  After looking around, I find this reference to teach you how to compute the MD5 hash, <a href="http://www.nikhedonia.com/notebook/entry/verifying-md5-checksum/">http://www.nikhedonia.com/notebook/entry/verifying-md5-checksum/</a>.  However i found that the MD5 hash in the checksum file stores as 32-characters, which is different from 16-bytes MD5 hash.  Finally I knew that this 32-characters string is the hex string of the 16 bytes MD5 values.  Therefore i have made some modifications and below is my code for your reference:</p>
<pre class="brush: csharp;">
public string ComputeMd5HashFromFile(string filePath)
{
StreamReader fileReader = null;
UTF8Encoding utf8Encoding = new System.Text.UTF8Encoding();
StringBuilder result = new StringBuilder(32);
byte[] hash = null;

try
{
fileReader = File.OpenText(filePath);
MD5 md5 = new MD5CryptoServiceProvider();
hash = md5.ComputeHash(utf8Encoding.GetBytes(fileReader.ReadToEnd()));

foreach (byte b in hash)
{
result.Append(b.ToString(&quot;x2&quot;).ToUpper()); // used to convert each byte to a hex string
}

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
if (fileReader != null) fileReader.Close();
}

return result.ToString().ToUpper();
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=101&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2009/01/02/compute-md5-checksum-in-hex-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>Create Custom Windows Shortcut</title>
		<link>http://dmidea.wordpress.com/2008/12/03/create-custom-windows-shortcut/</link>
		<comments>http://dmidea.wordpress.com/2008/12/03/create-custom-windows-shortcut/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 17:44:59 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Windows Shortcut]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=90</guid>
		<description><![CDATA[For my job, I often need to use the Windows Calculator to calculate the program results. Therefore I would like to find an easy way to open the Calculator &#8211; create a custom Windows shortcut. First create a shortcut of the program, then open its property window. There is a shortcut-key field in the dialog, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=90&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my job, I often need to use the Windows Calculator to calculate the program results. Therefore I would like to find an easy way to open the Calculator &#8211; create a custom Windows shortcut. First create a shortcut of the program, then open its property window. There is a shortcut-key field in the dialog, input any single character to activate keyboard shortcut. It&#8217;s awesome for me!!</p>
<p><img src="http://dmidea.files.wordpress.com/2008/12/0812_shortcut.gif?w=455" alt="" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=90&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2008/12/03/create-custom-windows-shortcut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>

		<media:content url="http://dmidea.files.wordpress.com/2008/12/0812_shortcut.gif" medium="image" />
	</item>
		<item>
		<title>Create context shortcut for Visual Studio msbuild</title>
		<link>http://dmidea.wordpress.com/2008/11/17/create-context-shortcut-for-visual-studio-msbuild/</link>
		<comments>http://dmidea.wordpress.com/2008/11/17/create-context-shortcut-for-visual-studio-msbuild/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 23:11:39 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[context menu]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=82</guid>
		<description><![CDATA[I have searched in the internet to find an easy way to rebuild my visual studio solution without open it.  Then I find there is a way to update the registry to provide a context shortcut to run msbuild command by right-click on .sln file from David Mohundro&#8217;s website. You can create a msbuild.reg file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=82&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have searched in the internet to find an easy way to rebuild my visual studio solution without open it.  Then I find there is a way to update the registry to provide a context shortcut to run msbuild command by right-click on .sln file from <a href="http://www.mohundro.com/blog/2007/04/13/ShellExtensionToRebuildSolutionsQuickly.aspx">David Mohundro&#8217;s website</a>.</p>
<p>You can create a msbuild.reg file by copying the below script (which this is for .net framework 3.5), and run this reg file.</p>
<p>Windows Registry Editor Version 5.00<br />
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\shell\msbuild]<br />
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\shell\msbuild\command]<br />
@=&#8221;\&#8221;C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\\MSBuild.exe\&#8221; /target:Rebuild \&#8221;%1\&#8221;"</p>
<p><img class="alignnone size-full wp-image-83" title="0811msbuild_shortcut" src="http://dmidea.files.wordpress.com/2008/11/0811msbuild_shortcut.jpg?w=222&#038;h=434" alt="0811msbuild_shortcut" width="222" height="434" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=82&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2008/11/17/create-context-shortcut-for-visual-studio-msbuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>

		<media:content url="http://dmidea.files.wordpress.com/2008/11/0811msbuild_shortcut.jpg" medium="image">
			<media:title type="html">0811msbuild_shortcut</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: onchange problem</title>
		<link>http://dmidea.wordpress.com/2008/11/04/javascript-onchange-problem/</link>
		<comments>http://dmidea.wordpress.com/2008/11/04/javascript-onchange-problem/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 01:23:46 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onblur]]></category>
		<category><![CDATA[onchange]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=65</guid>
		<description><![CDATA[I have wrote some javascript to try synchronize the value from textBox1 to textBox2, and then added to the textBox1 in cs file like this: String SyncValueScript = &#34;document.getElementById('&#34; + textBox2Control.ClientID + &#34;').value = this.value;&#34;; textBox1Control.Attributes.Add(&#34;onchange&#34;, SyncValueScript); However I found that there is a situation that onchange will not be fired, even the value of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=65&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have wrote some javascript to try synchronize the value from textBox1 to textBox2, and then added to the textBox1 in cs file like this:</p>
<pre class="brush: jscript;">
String SyncValueScript = &quot;document.getElementById('&quot; + textBox2Control.ClientID +
&quot;').value = this.value;&quot;;
textBox1Control.Attributes.Add(&quot;onchange&quot;, SyncValueScript);
</pre>
<p>However I found that there is a situation that onchange will not be fired, even the value of textBox1 is changed. Below is the step to reproduce this situation:</p>
<ol>
<li>Open two IE windows.</li>
<li>Copy some values in the clipboard and paste on textBox1 in IE window 1.</li>
<li>Then click on IE window 2.</li>
<li>Go back to the IE window 1 by click on controls other than textBox 1.</li>
<li>you will find that the value of textBox1 is not synced to textBox2.</li>
</ol>
<p>Solution: there is a very easy fix for this problem, just use &#8220;onblur&#8221; event instead of &#8220;onchange&#8221;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=65&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2008/11/04/javascript-onchange-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS: Custom File Logging</title>
		<link>http://dmidea.wordpress.com/2008/10/29/ssis-custom-file-logging/</link>
		<comments>http://dmidea.wordpress.com/2008/10/29/ssis-custom-file-logging/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 01:07:54 +0000</pubDate>
		<dc:creator>dmidea</dc:creator>
				<category><![CDATA[Tech Share]]></category>
		<category><![CDATA[Event Handler]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://dmidea.wordpress.com/?p=35</guid>
		<description><![CDATA[I have tried to use the out-of-the-box logging feature provided by the SSIS package under SSIS &#62; Logging.  However this do not allow me to log down some application-related information, such as file path, result count, etc.  As a result, I want to implement a custom file-based logging.  After research, I find that there are two [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=35&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have tried to use the out-of-the-box logging feature provided by the SSIS package under SSIS &gt; Logging.  However this do not allow me to log down some application-related information, such as file path, result count, etc.  As a result, I want to implement a custom file-based logging. </p>
<p>After research, I find that there are two ways I can implement the custom loggin &#8211; use script task to write log to text file or implement your own <a title="Email Log Provider Sample" href="http://msdn.microsoft.com/en-us/library/ms365179(SQL.90).aspx" target="_self">Integration Services log provider</a>.  For the sake of easy deployment, i choose to use script task to implement my custom file-based logging.  The followings are the steps I am going to do:</p>
<p>1. Create a log folder and assign the log file path<br />
2. Standard log script task to write log<br />
3. Uses event handler to log additional events such as OnError and OnWarning</p>
<p>First, create a log folder using File System Task together with File Connection.  Then concatenate the log file name to the variable in a script task:</p>
<p><img class="alignnone" title="Create Log folder and assign file path" src="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog2.jpg?w=633&#038;h=120" alt="" width="633" height="120" /></p>
<pre class="brush: csharp;">
Dts.Variables(&quot;SWIFTLogFilePath&quot;).Value = Dts.Variables(&quot;SWIFTLogFolder&quot;).Value.ToString() &amp;amp; _
                                          &quot;\\swift&quot; &amp;amp; Year(Now) &amp;amp; _
                                          IIf(Month(Now) &amp;lt; 10, &quot;0&quot;, &quot;&quot;).ToString() &amp;amp; Month(Now) &amp;amp; _
                                          IIf(Day(Now) &amp;lt; 10, &quot;0&quot;, &quot;&quot;).ToString() &amp;amp; Day(Now) &amp;amp; _
                                          &quot;.log&quot;
</pre>
<p>To remind, please ensure your variables are defined in ReadOnlyVariables / ReadWriteVariables.  Then you can create another script task to write log to a file.   This is the sample code for writing a log file:</p>
<p><img class="alignnone" title="For Each Loop Container" src="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog3.jpg?w=504&#038;h=531" alt="" width="504" height="531" /></p>
<pre class="brush: csharp;">
Public Sub WriteLog(ByVal logContent As String)
        Dim logWriter As StreamWriter

        Try
            logWriter = New StreamWriter(Dts.Variables(&quot;SWIFTLogFilePath&quot;).Value.ToString(), True)
            logWriter.WriteLine(logContent)
            logWriter.Close()
        Catch ex As Exception
            'Unexpected Exception
        End Try
    End Sub
</pre>
<p>Besides logging, i find that there is a trick/bug found in For Each Container.  You can see that I have duplicated to create log script task block in four different branches.  If I merge these four branches by pointing to the same log script task, the script task will not be executed.  Therefore it doesn&#8217;t support branch merging and runs tasks in sequential order only.</p>
<p><img class="alignnone" title="SSIS Event Handler" src="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog4.jpg?w=622&#038;h=165" alt="" width="622" height="165" /></p>
<p>The last thing I want to show you is the Event Handler, you can implement the event handler of OnError and OnWarning to capture these information into your log file; just go to &#8220;Event Handlers&#8221; tab and select Executable and Event you want to handle. Then just put a script task as previous one, but additional information like System::ErrorCode, and System::ErrorDescription can be logged down as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmidea.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmidea.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmidea.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmidea.wordpress.com&amp;blog=5242308&amp;post=35&amp;subd=dmidea&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dmidea.wordpress.com/2008/10/29/ssis-custom-file-logging/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d299c819c890fec4568768c6909c294?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmidea</media:title>
		</media:content>

		<media:content url="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog2.jpg" medium="image">
			<media:title type="html">Create Log folder and assign file path</media:title>
		</media:content>

		<media:content url="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog3.jpg" medium="image">
			<media:title type="html">For Each Loop Container</media:title>
		</media:content>

		<media:content url="http://dmidea.files.wordpress.com/2008/10/0810ssiscustomlog4.jpg" medium="image">
			<media:title type="html">SSIS Event Handler</media:title>
		</media:content>
	</item>
	</channel>
</rss>
