<?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>Bobio &#039;s dev blog</title>
	<atom:link href="http://bohu7.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bohu7.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 12 Dec 2011 22:10:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bohu7.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bobio &#039;s dev blog</title>
		<link>http://bohu7.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bohu7.wordpress.com/osd.xml" title="Bobio &#039;s dev blog" />
	<atom:link rel='hub' href='http://bohu7.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Multiple tier / dimension array in javascript</title>
		<link>http://bohu7.wordpress.com/2011/12/12/multiple-tier-dimension-array-in-javascript/</link>
		<comments>http://bohu7.wordpress.com/2011/12/12/multiple-tier-dimension-array-in-javascript/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 06:41:29 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[JS/CSS]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=128</guid>
		<description><![CDATA[It is possible to define a multiple tier javascript array  that each &#8220;member&#8221;can contain more primitive data types or array object,  below example shows 3 tier array. Top tier holds array object, eg:  new Array(&#8220;002&#8243;,new Array(&#8220;BB1&#8243;,&#8220;BB2&#8243;))  Second tier array holds two dimension data: a string type &#8220;002&#8243;, and another array object new Array(&#8220;BB1&#8243;,&#8221;BB2&#8243;) Third tier holds multiple dimension data: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=128&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is possible to define a multiple tier javascript array  that each &#8220;member&#8221;can contain more primitive data types or array object,  below example shows 3 tier array.</p>
<ul>
<li>Top tier holds array object, eg:  new <span style="font-size:x-small;">Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;002&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;BB1&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;BB2&#8243;</span></span><span style="font-size:x-small;">))</span></li>
<li> Second tier array holds two dimension data: a string type <strong>&#8220;002&#8243;</strong>, and another array object <strong>new Array(&#8220;BB1&#8243;,&#8221;BB2&#8243;)</strong></li>
<li>Third tier holds multiple dimension data: &#8220;BB1&#8243;,&#8221;BB2&#8243;</li>
</ul>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">script</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">type</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;text/javascript&#8221;&gt;</span></span></span></p>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">var</span></span><span style="font-size:x-small;"> array_demo = </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array( </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;001&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;AA1&#8243;</span></span><span style="font-size:x-small;">))  ,   </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;002&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;BB1&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;BB2&#8243;</span></span><span style="font-size:x-small;">))   ,   </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;003&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="font-size:x-small;"> Array(</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;CC1&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;CC2&#8243;</span></span><span style="font-size:x-small;">,</span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;CC3&#8243;</span></span><span style="font-size:x-small;">))    );</span></span></p>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&lt;/</span></span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">script</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&gt;</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=128&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/12/12/multiple-tier-dimension-array-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>NVARCHAR The size (8000) given to the parameter  exceeds the maximum allowed (4000)</title>
		<link>http://bohu7.wordpress.com/2011/11/28/nvarchar-the-size-8000-given-to-the-parameter-exceeds-the-maximum-allowed-4000/</link>
		<comments>http://bohu7.wordpress.com/2011/11/28/nvarchar-the-size-8000-given-to-the-parameter-exceeds-the-maximum-allowed-4000/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 01:01:30 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[MS-SQL]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[nvarchar]]></category>
		<category><![CDATA[varchar]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[maximum]]></category>
		<category><![CDATA[exceeds]]></category>
		<category><![CDATA[4000]]></category>
		<category><![CDATA[8000]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=121</guid>
		<description><![CDATA[When building dynamic TSQL query string with nvarchar type in MS SQL Server, it is possible to exceed the limit  of 4000 characters, this will causes query string to be truncated and fail to run. I have no luck with ntext type : The text, ntext, and image data types are invalid for local variables. varchar [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=121&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When building dynamic TSQL query string with <strong>nvarchar</strong> type in MS SQL Server, it is possible to exceed the limit  of 4000 characters, this will causes query string to be truncated and fail to run.</p>
<p>I have no luck with <strong>ntext</strong> type : The text, ntext, and image data types are invalid for local variables.</p>
<p><span style="color:#0000ff;"><strong>varchar</strong></span> is the correct type to use &#8212; it has a  limit of 8000 characters</p>
<p>you can define your query string as below:</p>
<p><strong>declare @@querystring varchar(max)</strong></p>
<p>or</p>
<p><strong>declare @@querystring varchar(8000)</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=121&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/11/28/nvarchar-the-size-8000-given-to-the-parameter-exceeds-the-maximum-allowed-4000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>MVC2 LoadingElementID not displaying in Safari</title>
		<link>http://bohu7.wordpress.com/2011/11/10/mvc2-loadingelementid-not-displaying-in-safari/</link>
		<comments>http://bohu7.wordpress.com/2011/11/10/mvc2-loadingelementid-not-displaying-in-safari/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 03:16:47 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[LoadingElementID]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[MVC 2]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=105</guid>
		<description><![CDATA[I have a MVC2 project that I am using Ajax form, ajax indicator div (LoadingElementId=&#8221;indicator&#8221;) displays perfectly in IE, Firefox and Chrome, but it doesn&#8217;t display in Safari. Solution:  change &#8220;display:none;&#8221; to &#8220;visibility:hidden;&#8221; in ajax indicator&#8217;s css class. Now it works for all browsers above.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=105&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a MVC2 project that I am using Ajax form, ajax indicator div (LoadingElementId=&#8221;indicator&#8221;) displays perfectly in IE, Firefox and Chrome, but it doesn&#8217;t display in Safari.</p>
<p>Solution:  change &#8220;display:none;&#8221; to<strong> &#8220;visibility:hidden;&#8221;</strong> in ajax indicator&#8217;s css class. Now it works for all browsers above.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=105&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/11/10/mvc2-loadingelementid-not-displaying-in-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>MVC2 Ajax not working in Firefox &#8211; Error &#8220;a is undefined&#8221;</title>
		<link>http://bohu7.wordpress.com/2011/08/24/mvc2-ajax-not-working-in-firefox-error-a-is-undefined/</link>
		<comments>http://bohu7.wordpress.com/2011/08/24/mvc2-ajax-not-working-in-firefox-error-a-is-undefined/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 05:40:30 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ArgumentUndefinedException]]></category>
		<category><![CDATA[eventObject]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[undefined]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=102</guid>
		<description><![CDATA[I was using MVC2 Ajax function with &#8220;this.form.onsubmit()&#8221;, it works on IE but not firefox, it causes an error &#8220;a is undefined&#8221; in /scripts/MicrosoftAjax.js    Line 6 if I use /scripts/MicrosoftAjax.debug.js , it says &#8220;Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: eventObject&#8221; The solution is here http://forums.asp.net/t/1515105.aspx/2/10  solved by tpeczek. 1. add a hidden submit button in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=102&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was using MVC2 Ajax function with &#8220;this.form.onsubmit()&#8221;, it works on IE but not firefox, it causes an error &#8220;a is undefined&#8221; in /scripts/MicrosoftAjax.js    Line 6</p>
<p>if I use /scripts/MicrosoftAjax.debug.js , it says &#8220;Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: eventObject&#8221;</p>
<p>The solution is here <a href="http://forums.asp.net/t/1515105.aspx/2/10">http://forums.asp.net/t/1515105.aspx/2/10</a>  solved by tpeczek.</p>
<p>1. add a hidden submit button in the form, for example:</p>
<p>&lt;<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">input</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">type</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=submit </span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">id</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;AJAXSubmitButton&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">name</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;AJAXSubmitButton&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">value</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;Update&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">style</span></span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">=&#8221;</span></span><span style="color:#ff0000;font-size:x-small;"><span style="color:#ff0000;font-size:x-small;">display</span></span><span style="font-size:x-small;">:</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">none</span></span><span style="font-size:x-small;">;</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">&#8220;</span></span><span style="color:#0000ff;font-size:x-small;">/&gt;</span></p>
<p>2. change ajax call function to</p>
<p>document.getElementById(&#8220;AJAXSubmitButton&#8221;).click();</p>
<p>so you are forcing the submit button to be clicked, to submit the ajax form.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=102&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/08/24/mvc2-ajax-not-working-in-firefox-error-a-is-undefined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>use Colobox with ASP.NET Ajax</title>
		<link>http://bohu7.wordpress.com/2011/03/21/use-colobox-with-asp-net-ajax/</link>
		<comments>http://bohu7.wordpress.com/2011/03/21/use-colobox-with-asp-net-ajax/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 22:30:14 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[JS/CSS]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[colorbox]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=98</guid>
		<description><![CDATA[ Colorbox is built on Jquery library,  by default, the colorbox link only works when the first time it loads or postback etc.  However ASP.NET Ajax is partial postback,  so after ajax update you may find colobox are not working any more. Below post describes the problem on Jquery with Ajax update panel and provide a good solution http://www.dotnetfunda.com/articles/article471-jquery-and-aspnet-ajax-updatepanel-.aspx [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=98&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> <a href="http://colorpowered.com/colorbox/">Colorbox </a>is built on Jquery library,  by default, the colorbox link only works when the first time it loads or postback etc.  However ASP.NET Ajax is <strong>partial postback</strong>,  so after ajax update you may find colobox are not working any more.</p>
<p>Below post describes the problem on Jquery with Ajax update panel and provide a good solution</p>
<p><a href="http://www.dotnetfunda.com/articles/article471-jquery-and-aspnet-ajax-updatepanel-.aspx">http://www.dotnetfunda.com/articles/article471-jquery-and-aspnet-ajax-updatepanel-.aspx</a></p>
<p>It can be used on colorbox as well, open jquery.colorbox.js  and add a function &#8220;<span style="font-size:x-small;">pageLoad</span>&#8221; ,and copy the content from &#8220;$(document).ready(<span class="JS_KEY"><span style="color:#0000ff;">function</span></span>(){&#8221; to &#8220;pageLoad&#8221;</p>
<p><span style="font-size:x-small;">$(document).ready(function(){<br />
     <strong>$(&#8220;.example7&#8243;).colorbox({width:&#8221;80%&#8221;, height:&#8221;80%&#8221;, iframe:true});</strong><br />
});</span><span style="font-size:x-small;"> <br />
function pageLoad(sender,args){</p>
<p>if (args.get_isPartialLoad())</p>
<p>   {<br />
       $(&#8220;.example7&#8243;).colorbox({width:&#8221;80%&#8221;, height:&#8221;80%&#8221;, iframe:true});<a></a></p>
<div><span style="font-size:x-small;">   }</span></div>
<p><span style="font-size:x-small;">}</p>
<p></span></p>
<p></span></p>
<div><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"><span style="color:#000000;"> </span></span></span><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"><span style="color:#000000;"> </span></span></span><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"><span style="color:#000000;"> </span></span></span></p>
<p><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"><span style="color:#000000;"></p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;width:1px;height:1px;overflow:hidden;top:0;left:-10000px;">﻿</div>
<p> </p>
<p></span></span></span></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=98&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/03/21/use-colobox-with-asp-net-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>Null Value in first row causes data lost in whole dataset &#8211; Provider=Microsoft.Jet.OLEDB.4.0</title>
		<link>http://bohu7.wordpress.com/2011/03/11/null-value-in-first-row-causes-data-lost-in-whole-dataset/</link>
		<comments>http://bohu7.wordpress.com/2011/03/11/null-value-in-first-row-causes-data-lost-in-whole-dataset/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 05:27:53 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=95</guid>
		<description><![CDATA[I have a Comma delimited text file wit no header, the first row is the first data record. I am using OleDB to receive a dataset conn_csv_str = &#8220;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8221; + filepath + &#8220;;Extended Properties=&#8217;text;FMT=Delimited;HDR=No&#8217;;   I found if I have null value in the first row, for example in addressline column, the rest of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=95&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a Comma delimited text file wit no header, the first row is the first data record. I am using OleDB to receive a dataset</p>
<div><span style="font-size:x-small;">conn_csv_str = <span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8221;</span></span><span style="font-size:x-small;"> + filepath + </span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;;Extended Properties=&#8217;text;FMT=Delimited;HDR=No&#8217;</span></span><span style="font-size:x-small;">;</span></span></div>
<p><span style="font-size:x-small;"> </span></p>
<p>I found if I have null value in the first row, for example in addressline column, the rest of the records will be null in addressline column as well!</p>
<p>After some reseach I found the answer on MS website</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms709353(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/ms709353(v=vs.85).aspx</a></p>
<p>The Oledb driver is trying to determine the data type of each column, it must get confused by null value in the first row, so it ignore values for the rest of the rows.</p>
<p>The solution is to create a schema.ini file in the same directory with your text file, and before you retrive dataset, add configuration lines into schema.ini file. </p>
<p>for example, if my file is called helloworld.txt, there are 4 columns in my file: firstname, lastname, adressline,age</p>
<p>I will call below method:</p>
<p>AddTXTFileSchema<strong>(&#8220;C:\my_file_directory\&#8221;,&#8221;schema.ini&#8221;,&#8221;helloworld.txt&#8221;)</strong></p>
<div><span style="font-size:x-small;"> </span></div>
<p><span style="font-size:x-small;"> </span></p>
<div>
<div><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">public<span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">void</span></span><span style="color:#000000;font-size:x-small;"> AddTXTFileSchema(</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string</span></span><span style="color:#000000;font-size:x-small;"> filepath, </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string</span></span><span style="color:#000000;font-size:x-small;"> schemafilename, </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string</span></span></span></span></span></span></div>
<div><span style="font-size:x-small;"><span style="color:#000000;">filename)</span></span></div>
<div><span style="font-size:x-small;">{</span></div>
<p><span style="font-size:x-small;"><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">FileStream</span></span><span style="font-size:x-small;"> fs = </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">FileStream</span></span><span style="font-size:x-small;">(filepath + </span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;/&#8221;</span></span><span style="font-size:x-small;"> + schemafilename, </span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">FileMode</span></span><span style="font-size:x-small;">.Append, </span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">FileAccess</span></span></span></p>
<div><span style="font-size:x-small;">.Write);</span></div>
<div><span style="font-size:x-small;"><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">StreamWriter</span></span><span style="font-size:x-small;"> sw = </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">StreamWriter</span></span></span></div>
<div><span style="font-size:x-small;">(fs);</span></div>
<div><span style="font-size:x-small;">sw.WriteLine(<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;["</span></span><span style="font-size:x-small;"> + filename + </span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">"]&#8220;</span></span></span></div>
<div><span style="font-size:x-small;">);</span></div>
<div><span style="font-size:x-small;">sw.WriteLine(<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Col1=c_firstname Text&#8221;</span></span></span></div>
<div><span style="font-size:x-small;">);</span></div>
<div><span style="font-size:x-small;">sw.WriteLine(<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Col2=lastname Text&#8221;</span></span></span></div>
<div><span style="font-size:x-small;">);</span></div>
<div><span style="font-size:x-small;">sw.WriteLine(<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Col3=addressline Text&#8221;</span></span></span></div>
<div><span style="font-size:x-small;">);</span></div>
<div><span style="font-size:x-small;">sw.WriteLine(<span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Col4=age Short&#8221;</span></span><span style="font-size:x-small;">);</span></span></div>
<p><span style="font-size:x-small;"> </span></p>
<div><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"> </span></span></p>
<div><span style="font-size:x-small;">sw.Close();</span></div>
<div><span style="font-size:x-small;">}</span></div>
<p><span style="font-size:x-small;"> </span></p>
</div>
<div><span style="color:#008000;font-size:x-small;"> </span></div>
<p>notice you can also specify the delimiter (tab, csv, customer etc), after [filename] line, it is very handy if you are using customer delimiter for example  pipe &#8220;|&#8221;.</p>
<p>The content of schema.ini will keep grouping as you handle more files, it is also a good idea to do housekeeping to clear schema.ini content once a while.</p>
<p>After you add entries to schema.ini file, you can use oledb to retrieve dataset .</p>
<div><span style="font-size:x-small;"> </span></div>
<p><span style="font-size:x-small;"> </span></p>
<div><span style="color:#008000;font-size:x-small;"><span style="color:#008000;font-size:x-small;"> </span></span></p>
<div><span style="font-size:x-small;"> </span></div>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">public</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">DataSet</span></span><span style="font-size:x-small;"> ParseTXTFileWithNoHeader(</span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string</span></span><span style="font-size:x-small;"> filepath, </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string </span></span></span></p>
<div><span style="font-size:x-small;">filename){</span></div>
<p><span style="font-size:x-small;"><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">DataSet</span></span><span style="font-size:x-small;"> ds = </span><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">DataSet</span></span></span></p>
<div><span style="font-size:x-small;">(); </span></div>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string </span></span></span></p>
<div><span style="font-size:x-small;">conn_csv_str;conn_csv_str = <span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8221;</span></span><span style="font-size:x-small;"> + filepath + </span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;;Extended Properties=&#8217;text;FMT=Delimited;HDR=No&#8217;&#8221;</span></span><span style="font-size:x-small;">;</span></span></div>
<div><span style="font-size:x-small;"> </span></div>
<p><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">string </span></span></span></p>
<div><span style="font-size:x-small;">sql_select; </span></div>
<p><span style="font-size:x-small;"><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">OleDbConnection</span></span></span></p>
<div><span style="font-size:x-small;">obj_oledb_con; </span></div>
<p><span style="font-size:x-small;"><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">OleDbDataAdapter </span></span></span></p>
<div><span style="font-size:x-small;">obj_oledb_da;obj_oledb_con = <span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">OleDbConnection </span></span></span></div>
<div><span style="font-size:x-small;">(conn_csv_str);</span></div>
<div><span style="font-size:x-small;">obj_oledb_con.Open();</span></div>
<div><span style="font-size:x-small;">sql_select = <span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">&#8220;select * from ["</span></span><span style="font-size:x-small;"> + filename + </span><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;">"]&#8220;</span></span></span></div>
<p><span style="font-size:x-small;"><span style="font-size:x-small;">;</span><span style="font-size:x-small;"> </span></span></p>
<div><span style="font-size:x-small;"><span style="font-size:x-small;">obj_oledb_da =</span></span></div>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">new</span></span><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">OleDbDataAdapter</span></span> <span style="font-size:x-small;">(sql_select, obj_oledb_con);</span><span style="font-size:x-small;"> </span></span></span></p>
<div><span style="font-size:x-small;">obj_oledb_da.Fill(ds);</span></div>
<p><span style="font-size:x-small;">obj_oledb_con.Close();</span></p>
<p><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;">return</span></span> <span style="font-size:x-small;">ds;</span></p>
<div><span style="font-size:x-small;">}</span></div>
<p><span style="font-size:x-small;"> </span></p>
</div>
<div><span style="color:#008000;font-size:x-small;">// Parse Text File with No Header</span></div>
</div>
<div> </div>
<div> </div>
<div><span style="color:#0000ff;font-size:x-small;"> </span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=95&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/03/11/null-value-in-first-row-causes-data-lost-in-whole-dataset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET convert hyperlink to url string</title>
		<link>http://bohu7.wordpress.com/2011/03/10/net-convert-hyperlink-to-url-string/</link>
		<comments>http://bohu7.wordpress.com/2011/03/10/net-convert-hyperlink-to-url-string/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 03:36:14 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=60</guid>
		<description><![CDATA[try converting html code to text version? below code will remove all html tags Dim objRegEx As System.Text.RegularExpressions.Regex mystring= objRegEx.Replace(mystring, "&#60;[^&#62;]*&#62;", "") But what if I also need to extract and keep all the urls from &#60;a&#62;tags. I write a recursion function to convert all &#60;a&#62;&#60;/a&#62; to simple url string, it is in VB because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=60&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>try converting html code to text version? below code will remove all html tags</p>
<pre>
Dim objRegEx As System.Text.RegularExpressions.Regex
               mystring= objRegEx.Replace(mystring, "&lt;[^&gt;]*&gt;", "")</pre>
<p>But what if I also need to extract and keep all the urls from &lt;a&gt;tags.<br />
I write a recursion function to convert all &lt;a&gt;&lt;/a&gt; to simple url string, it is in VB because the original project was developed in VB, yes I miss C# syntax <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<pre>Public Function ConvertHyperlinksToText(ByVal source As String, ByVal startIndex As Integer) As String

        Dim result As String   ' Result to return
        result = source

        ' wrap the extracted URL string , for example you can use (),
        ' so "&lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;" will become "(http://www.google.com)"
        ' in this example I use space before and after the url

        Dim urlLeftWrapperString As String = " "
        Dim urlRightWrapperString As String = " "

        ' Tag Start &amp; End
        Dim tagStart As String = "&lt;a "
        Dim tagEnd As String = "&lt;/a&gt;"

        ' URL link Start &amp; End, surround by double quote: href="http://www.google.com"
        Dim doubleQuoteLinkStart As String = " href="""
        Dim doubleQuoteLinkEnd As String = """"

        ' URL link Start &amp; End, surround by single quote: href='http://www.google.com'
        Dim singleQuoteLinkStart As String = " href='"
        Dim singleQuoteLinkEnd As String = "'"

        Dim pos_tagStart As Integer
        Dim pos_tagEnd As Integer

        ' find position of tagStart and tagend

        pos_tagStart = result.ToLower().IndexOf(tagStart, startIndex)
        pos_tagEnd = result.ToLower().IndexOf(tagEnd, startIndex)

        ' Find the next <a></a> tag block

        If pos_tagStart &gt; -1 And pos_tagEnd &gt; -1 And pos_tagEnd &gt; pos_tagStart Then
            Dim stringLeft As String
            Dim stringTagBlock As String
            Dim stringRight As String

            stringLeft = result.Substring(0, pos_tagStart)
            stringTagBlock = result.Substring(pos_tagStart, pos_tagEnd + 4 - pos_tagStart)   ' content in <a></a>
            stringRight = result.Substring(pos_tagEnd + 4, result.Length - (pos_tagEnd + 4))    '  is 4 characters

            If stringTagBlock &lt;&gt; "" Then

                Dim findHref As Boolean = False

                ' try searching for Double Quote surrounded href attribute:  href="...." start

                Dim pos_doubleQuoteLinkStart As Integer
                Dim pos_doubleQuoteLinkEnd As Integer

                pos_doubleQuoteLinkStart = stringTagBlock.ToLower().IndexOf(doubleQuoteLinkStart)
                pos_doubleQuoteLinkEnd = stringTagBlock.ToLower().IndexOf(doubleQuoteLinkEnd, pos_doubleQuoteLinkStart + 7)

                If pos_doubleQuoteLinkStart &gt; -1 And pos_doubleQuoteLinkEnd &gt; -1 And pos_doubleQuoteLinkEnd &gt; pos_doubleQuoteLinkStart Then

                    Dim URL As String

                    URL = stringTagBlock.Substring(pos_doubleQuoteLinkStart + 7, pos_doubleQuoteLinkEnd - (pos_doubleQuoteLinkStart + 7)) ' " href=""  -  7 characters

                    ' concatenation result String :   stringLeft +  + URL +  + stringRight

                    result = stringLeft &amp; urlLeftWrapperString &amp; URL &amp; urlRightWrapperString &amp; stringRight
                    startIndex = ((stringLeft &amp; urlLeftWrapperString &amp; URL &amp; urlRightWrapperString).Length) 'just set startIndex to the end of the tagEnd

                    findHref = True

                End If

                'if we haven't find double quote surrounded href attribute
                ' try searching for Single Quote surrounded href attribute:  href='....' start

                If findHref = False Then

                    Dim pos_singleQuoteLinkStart As Integer
                    Dim pos_singleQuoteLinkEnd As Integer

                    pos_singleQuoteLinkStart = stringTagBlock.ToLower().IndexOf(singleQuoteLinkStart)
                    pos_singleQuoteLinkEnd = stringTagBlock.ToLower().IndexOf(singleQuoteLinkEnd, pos_singleQuoteLinkStart + 7)

                    If pos_singleQuoteLinkStart &gt; -1 And pos_singleQuoteLinkEnd &gt; -1 And pos_singleQuoteLinkEnd &gt; pos_singleQuoteLinkStart Then

                        Dim URL As String

                        URL = stringTagBlock.Substring(pos_singleQuoteLinkStart + 7, pos_singleQuoteLinkEnd - (pos_singleQuoteLinkStart + 7)) ' " href='"  -  7 characters

                        ' concatenation result String :   stringLeft +  + URL +  + stringRight

                        result = stringLeft &amp; urlLeftWrapperString &amp; URL &amp; urlRightWrapperString &amp; stringRight

                        startIndex = ((stringLeft &amp; urlLeftWrapperString &amp; URL &amp; urlRightWrapperString).Length) 'just set startIndex to the end of the tagEnd

                        findHref = True

                    End If

                End If

                If findHref = False Then ' didn't find herf , just set startIndex to the end of the tagEnd

                    startIndex = (pos_tagEnd + 4)

                End If

            Else

                ' if stringTagBlock is empty, just set startIndex to the end of the tagEnd
                startIndex = (pos_tagEnd + 4)

            End If

            ' if we still can't find href attribute or block content is empty, that is because <a></a> block is probably not well formatted
            ' so we just set startIndex from the end of this block, our recursion function is not dead-locked
            ' call this recursion function again
            result = ConvertHyperlinksToText(result, startIndex)

        Else

            ' no <a></a> block found

            Return result

        End If

        Return result

    End Function
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=60&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/03/10/net-convert-hyperlink-to-url-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2005: Format datetime in TSQL</title>
		<link>http://bohu7.wordpress.com/2011/02/23/sql-server-2005-format-datetime-in-tsql/</link>
		<comments>http://bohu7.wordpress.com/2011/02/23/sql-server-2005-format-datetime-in-tsql/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 03:03:25 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
		
		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=57</guid>
		<description><![CDATA[http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=57&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/">http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=57&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2011/02/23/sql-server-2005-format-datetime-in-tsql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>IE7: How to close a window in javascript, without confirming the popup dialog</title>
		<link>http://bohu7.wordpress.com/2010/12/19/ie7-how-to-close-a-window-in-javascript-without-confirm-popup-dialog/</link>
		<comments>http://bohu7.wordpress.com/2010/12/19/ie7-how-to-close-a-window-in-javascript-without-confirm-popup-dialog/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 23:05:45 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
		
		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=51</guid>
		<description><![CDATA[&#60;script type=&#8221;text/javascript&#8221;&#62; window.open(&#8221;, &#8216;_self&#8217;, &#8221;); window.close(); &#60;/script&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=51&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>window.open(&#8221;, &#8216;_self&#8217;, &#8221;);</p>
<p>window.close();</p>
<p>&lt;/script&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=51&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2010/12/19/ie7-how-to-close-a-window-in-javascript-without-confirm-popup-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
		<item>
		<title>MS SQL: import records and maintain Identity records</title>
		<link>http://bohu7.wordpress.com/2010/11/30/ms-sql-import-records-and-maintain-identity-records/</link>
		<comments>http://bohu7.wordpress.com/2010/11/30/ms-sql-import-records-and-maintain-identity-records/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 22:49:48 +0000</pubDate>
		<dc:creator>bohu7</dc:creator>
				<category><![CDATA[MS-SQL]]></category>

		<guid isPermaLink="false">http://bohu7.wordpress.com/?p=45</guid>
		<description><![CDATA[  set identity_insert [target_table] on  Insert into target_table (column1, column2, column3)  select (column1, column2, column3) from source_table set identity_insert [target_table] off    <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=45&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#3366ff;"> </span></p>
<p><span style="color:#3366ff;">set identity_insert</span> [target_table] <span style="color:#3366ff;">on</span></p>
<p> <span style="color:#3366ff;">Insert into </span>target_table (column1, column2, column3)<br />
 <span style="color:#3366ff;">select </span>(column1, column2, column3) <span style="color:#3366ff;">from </span>source_table</p>
<p><span style="color:#3366ff;">set identity_insert</span> [target_table] <span style="color:#3366ff;">off</span></p>
<p><span style="color:#3366ff;"> </span></p>
<p><span style="color:#3366ff;"> </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bohu7.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bohu7.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bohu7.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bohu7.wordpress.com&amp;blog=5734327&amp;post=45&amp;subd=bohu7&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bohu7.wordpress.com/2010/11/30/ms-sql-import-records-and-maintain-identity-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63e910632e82a3d7ae80fadc7732974a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bohu7</media:title>
		</media:content>
	</item>
	</channel>
</rss>
