<?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/"
	>

<channel>
	<title>Stormwild Interactive &#187; Programming</title>
	<atom:link href="http://blog.stormwild.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stormwild.net</link>
	<description>Web Development</description>
	<lastBuildDate>Wed, 07 Jul 2010 14:59:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Microsoft Launches Free Tool WebMatrix</title>
		<link>http://blog.stormwild.net/programming/microsoft-launches-free-tool-webmatrix/</link>
		<comments>http://blog.stormwild.net/programming/microsoft-launches-free-tool-webmatrix/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 13:38:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=109</guid>
		<description><![CDATA[WebMatrix makes development with ASP .NET much easier for beginners. Like PHP it allows for code snippets to be included within an html page. Learn more about this new tool from Microsoft. WebMatrix]]></description>
			<content:encoded><![CDATA[<p>WebMatrix makes development with ASP .NET much easier for beginners. Like PHP it allows for code snippets to be included within an html page. Learn more about this new tool from Microsoft.</p>
<p><a href="http://www.microsoft.com/web/webmatrix/">WebMatrix</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/microsoft-launches-free-tool-webmatrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To View Column Names For A Table In T-SQL</title>
		<link>http://blog.stormwild.net/programming/how-to-view-column-names-for-a-table-in-t-sql/</link>
		<comments>http://blog.stormwild.net/programming/how-to-view-column-names-for-a-table-in-t-sql/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 12:43:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=98</guid>
		<description><![CDATA[SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '&#60;TABLE NAME&#62;' ORDER BY ORDINAL_POSITION &#160; &#160;]]></description>
			<content:encoded><![CDATA[<pre>SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = '&lt;TABLE NAME&gt;'
ORDER BY ORDINAL_POSITION</pre>
<p>&nbsp;<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/how-to-view-column-names-for-a-table-in-t-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display line numbers in Visual C# 2008 Express</title>
		<link>http://blog.stormwild.net/programming/display-line-numbers-in-visual-c-2008-express/</link>
		<comments>http://blog.stormwild.net/programming/display-line-numbers-in-visual-c-2008-express/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 03:28:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[line numbers]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=74</guid>
		<description><![CDATA[To display line numbers in code On the Tools menu selecti, Options. In the Text Editor folder, choose the General options in the All Languages subfolder to set this option globally Under Display, select Line numbers. If you do not &#8230; <a href="http://blog.stormwild.net/programming/display-line-numbers-in-visual-c-2008-express/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.stormwild.net/wp-content/uploads/2009/12/display_line_numbers_vce-e1261280670315.png"><img class="alignnone size-full wp-image-77" title="Display Line Numbers in Visual C# 2008 Express" src="http://blog.stormwild.net/wp-content/uploads/2009/12/display_line_numbers_vce-e1261280670315.png" alt="" width="500" height="291" /></a></p>
<p>To display line numbers in code</p>
<ol>
<li>On the <strong>Tools</strong> menu selecti, <strong>Options</strong>.</li>
<li>In the <strong>Text Editor</strong> folder, choose the <strong>General</strong> options in the  <strong>All Languages</strong> subfolder to set this option globally</li>
<li>Under <strong>Display</strong>, select <strong>Line numbers</strong>.</li>
</ol>
<p><em>If you do not see the <strong>All Languages</strong> subfolder or the <strong>Display</strong> section, make sure that the <strong>Show all settings</strong> checkbox at the bottom of the window is checked.</em></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms165340(VS.80).aspx" target="_blank">Reference</a><em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/display-line-numbers-in-visual-c-2008-express/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating INSERT statements from a table in SQL Server</title>
		<link>http://blog.stormwild.net/programming/generating-insert-statements-from-a-table-in-sql-server/</link>
		<comments>http://blog.stormwild.net/programming/generating-insert-statements-from-a-table-in-sql-server/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 11:51:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=62</guid>
		<description><![CDATA[This post provides a useful stored procedure for creating INSERT statement for data in a table.]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://www.codeproject.com/KB/database/InsertGeneratorPack.aspx" target="_blank">post</a> provides a useful stored procedure for creating INSERT statement for data in a table.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/generating-insert-statements-from-a-table-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Validating Positive Numbers Use Only A RangeValidator</title>
		<link>http://blog.stormwild.net/programming/when-validating-positive-numbers-use-only-a-rangevalidator/</link>
		<comments>http://blog.stormwild.net/programming/when-validating-positive-numbers-use-only-a-rangevalidator/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 13:32:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[validators]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=57</guid>
		<description><![CDATA[When requiring the user to enter only positive numbers (integer, double, currency) within a specified limit, you do not need to have both a RegularExpressionValidator to check for positive values and a RangeValidator to provide a limit. You can just &#8230; <a href="http://blog.stormwild.net/programming/when-validating-positive-numbers-use-only-a-rangevalidator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When requiring the user to enter only positive numbers (integer, double, currency)  within a specified limit, you do not need to have both a RegularExpressionValidator to check for positive values and a RangeValidator to provide a limit. You can just use the RangeValidator and just set the Minimum property to 0. (Visual Web Developer Express 2008 and .NET 3.5)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/when-validating-positive-numbers-use-only-a-rangevalidator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read-Only Properties Cannot Be Exposed by XML Web Services</title>
		<link>http://blog.stormwild.net/programming/read-only-properties-cannot-be-exposed-by-xml-web-services/</link>
		<comments>http://blog.stormwild.net/programming/read-only-properties-cannot-be-exposed-by-xml-web-services/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 15:10:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=55</guid>
		<description><![CDATA[I recently encountered this problem when I was trying to return a simple object with several public properties. It seems one of the properties was not being exposed in the XML returned by the web service. I wondered what could &#8230; <a href="http://blog.stormwild.net/programming/read-only-properties-cannot-be-exposed-by-xml-web-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently encountered this problem when I was trying to return a simple object with several public properties. It seems one of the properties was not being exposed in the XML returned by the web service. I wondered what could be the difference when I stumbled upon this thread:</p>
<p><a href="http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.webservices&#038;tid=fcf363d6-3bb0-48f3-979f-e026831680fa&#038;cat=en_US_c7c21e0a-c5db-49ce-9f55-03c2d2e7ac16&#038;lang=en&#038;cr=US&#038;sloc=&#038;p=1">C# get property not visible in Web Services General</a></p>
<p>which led to this KB article:</p>
<p><a href="http://support.microsoft.com/kb/313584">Read-Only Properties Cannot Be Exposed by XML Web Services</a></p>
<p>It seems this is by design. The workaround would be to create an empty setter for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/read-only-properties-cannot-be-exposed-by-xml-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Krumo: Replacement for print_r(); and var_dump();</title>
		<link>http://blog.stormwild.net/programming/krumo-replacement-for-print_r-and-var_dump/</link>
		<comments>http://blog.stormwild.net/programming/krumo-replacement-for-print_r-and-var_dump/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 14:43:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[krumo]]></category>
		<category><![CDATA[print_r]]></category>
		<category><![CDATA[var_dump]]></category>

		<guid isPermaLink="false">http://blog.stormwild.net/?p=37</guid>
		<description><![CDATA[Krumo looks like a very useful tool for debugging; replacing print_r() and var_dump() functions. I first found out about this class from the comments by kaloyan at gmail dot com in the var_dump() page in http://www.php.net/var_dump]]></description>
			<content:encoded><![CDATA[<p><a href="http://krumo.sourceforge.net/" target="_blank">Krumo</a> looks like a very useful tool for debugging; replacing print_r() and var_dump() functions. I first found out about this class from the comments by kaloyan at gmail dot com in the var_dump() page in <a href="http://www.php.net/var_dump" target="_blank">http://www.php.net/var_dump</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/krumo-replacement-for-print_r-and-var_dump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Form: How to set message for NotEmpty when setRequired(true)</title>
		<link>http://blog.stormwild.net/programming/zend_form-how-to-set-message-for-notempty-when-setrequiredtrue/</link>
		<comments>http://blog.stormwild.net/programming/zend_form-how-to-set-message-for-notempty-when-setrequiredtrue/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 08:11:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://stormwild.net/blog/?p=26</guid>
		<description><![CDATA[When, in a subclass of Zend_Form, a Zend_Form_Element is setRequired(true) it automatically adds a NotEmpty validator using the default message. To override the default message add a NotEmpty validator at the top of the list of validators and set breakChainOnFailure &#8230; <a href="http://blog.stormwild.net/programming/zend_form-how-to-set-message-for-notempty-when-setrequiredtrue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When, in a subclass of Zend_Form, a Zend_Form_Element is setRequired(true) it automatically adds a NotEmpty validator using the default message. To override the default message add a NotEmpty validator at the top of the list of validators and set <span>breakChainOnFailure</span> to true.</p>
<pre>$username = new Zend_Form_Element_Text('username');
$username-&gt;setLabel('Username')
-&gt;setRequired(true)
-&gt;addFilter('StripTags')
-&gt;addFilter('StringTrim')
-&gt;addValidator('NotEmpty', true, array(
     'messages' =&gt; array(
          'isEmpty' =&gt; 'Username is required'
     )
  ))
-&gt;addValidator('Alnum', false, array(
     'messages' =&gt; array(
          'notAlnum' =&gt; 'Use only letters and numbers'
     )
  ));</pre>
<p>
The solution, given by <a href="http://weierophinney.net/" target="_blank">Matthew Weier O&#8217;Phinney</a>,  was found in the following thread:</p>
<p><a href="http://www.nabble.com/Form-Validation-Messages-td15351486.html" target="_blank">Form Validation Messages</a></p>
<p>Related threads:</p>
<p><a href="http://www.nabble.com/how-to-set-error-message-for-Required-form-validator--td18427046.html" target="_blank">how to set error message for Required form validator?</a></p>
<p><a href="http://stackoverflow.com/questions/34848/using-zend-framework-and-setting-a-zendformelement-form-field-to-be-required-h" target="_blank">Using Zend Framework and setting a Zend_Form_Element form field to be required, how do I change the validator used to ensure that the element is not blank</a></p>
<p><a href="http://framework.zend.com/issues/browse/ZF-2806" target="_blank">Zend_Form_Element NotEmpy validation when required is set to true</a></p>
<p>The validation failure message keys, i.e. isEmpty, notAlnum, can be found in the <a href="http://framework.zend.com/apidoc/core/" target="_blank">API Docs</a> or by directly reading the validation class file in the library/Zend/Validate folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/zend_form-how-to-set-message-for-notempty-when-setrequiredtrue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot execute queries while other unbuffered queries are active</title>
		<link>http://blog.stormwild.net/programming/cannot-execute-queries-while-other-unbuffered-queries-are-active/</link>
		<comments>http://blog.stormwild.net/programming/cannot-execute-queries-while-other-unbuffered-queries-are-active/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:34:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://stormwild.net/blog/?p=17</guid>
		<description><![CDATA[Cannot execute queries while other unbuffered queries are active Can&#8217;t execute subsequent query after multiple queries from same Pdo_Mysql-&#62;exec() call Can&#8217;t execute multiple stored procedures with Pdo_Mysql Using the following code found in the Zend Framework Quickstart: Create a Model &#8230; <a href="http://blog.stormwild.net/programming/cannot-execute-queries-while-other-unbuffered-queries-are-active/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://bugs.php.net/bug.php?id=44081" target="_blank">Cannot execute queries while other unbuffered queries are active</a></p>
<p><a href="http://framework.zend.com/issues/browse/ZF-5576" target="_blank">Can&#8217;t execute subsequent query after multiple queries from same Pdo_Mysql-&gt;exec() call</a></p>
<p><a href="http://framework.zend.com/issues/browse/ZF-4951" target="_blank">Can&#8217;t execute multiple stored procedures with Pdo_Mysql</a></p>
<p>Using the following code found in the <a href="http://framework.zend.com/docs/quickstart/create-a-model-and-database-table" target="_blank">Zend Framework Quickstart: Create a Model and Database Table</a></p>
<pre><span class="comment">// this block executes the actual statements that were loaded from </span>
<span class="comment">// the schema file.</span>
<span class="keyword">try</span> {
    <span class="variable">$schemaSql</span> = file_get_contents(<span class="string">'./schema.sqlite.sql'</span>);
    <span class="comment">// use the connection directly to load sql in batches</span>
    <span class="variable">$dbAdapter</span>-&gt;getConnection()-&gt;exec(<span class="variable">$schemaSql</span>);
    <span class="keyword">echo</span> PHP_EOL;
    <span class="keyword">echo</span> <span class="string">'Database Created'</span>;
    <span class="keyword">echo</span> PHP_EOL;

    <span class="keyword">if</span> (<span class="variable">$withData</span>) {
        <span class="variable">$dataSql</span> = file_get_contents(<span class="string">'./data.sqlite.sql'</span>);
        <span class="comment">// use the connection directly to load sql in batches</span>
        <span class="variable">$dbAdapter</span>-&gt;getConnection()-&gt;exec(<span class="variable">$dataSql</span>);
        <span class="keyword">echo</span> <span class="string">'Data Loaded.'</span>;
        <span class="keyword">echo</span> PHP_EOL;
    }

} <span class="keyword">catch</span> (<span class="keyword">Exception</span> <span class="variable">$e</span>) {
    <span class="keyword">echo</span> <span class="string">'AN ERROR HAS OCCURED:'</span> . PHP_EOL;
    <span class="keyword">echo</span> <span class="variable">$e</span>-&gt;getMessage() . PHP_EOL;
    <span class="keyword">return</span> false;
}</pre>
<p>Note that $dbAdapter-&gt;getConnection()-&gt;exec() gets called twice.</p>
<p>I encountered this issue when calling Pdo_Mysql-&gt;exec() or in the Zend Framework calling $dbAdapter-&gt;getConnection()-&gt;exec($schemaSql) one after the other.</p>
<p>One way to prevent the error was to call $dbAdapter-&gt;closeConnection() after each exec call. Another way I worked around this problem was to just execute the $schemaSql and the $dataSql in one exec call like below;</p>
<pre>$schemaSql = file_get_contents('schema.sql', 1);
$dataSql = file_get_contents('data.sql', 1);
// use the connection directly to load sql in batches
$dbAdapter-&gt;getConnection()-&gt;exec($schemaSql . $dataSql);</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.stormwild.net/programming/cannot-execute-queries-while-other-unbuffered-queries-are-active/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
