<?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>WebPaws.com &#187; VB</title>
	<atom:link href="http://webpaws.com/blog/tag/vb/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpaws.com/blog</link>
	<description>Internet Marketing and Design Services for Turnkey Web Solutions</description>
	<lastBuildDate>Thu, 10 May 2012 02:17:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Conversion from type &#8216;DBNull&#8217; to type &#8216;String&#8217; is not valid</title>
		<link>http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/</link>
		<comments>http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 05:51:25 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[VB.net]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[DBNull]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=108</guid>
		<description><![CDATA[In a VB.net application, retrieving variables from a database, if the value was null, it would cause the error, &#8220;Conversion from type &#8216;DBNull&#8217; to type &#8216;String&#8217; is not valid&#8221;.  A work-around to stop this error was to create a function that would evaluate the imported database variable for a null value as an object then [&#8230;] <a class="more-link" href="http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/">&#8595; Read the rest of this entry...</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/">Conversion from type &#8216;DBNull&#8217; to type &#8216;String&#8217; is not valid</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F108%2Fconversion-from-type-dbnull-to-type-string-is-not-valid%2F&amp;title=Conversion+from+type+%26%238216%3BDBNull%26%238217%3B+to+type+%26%238216%3BString%26%238217%3B+is+not+valid&amp;summary=In+a+VB.net+application%2C+retrieving+variables+from+a+database%2C+if+the+value+was+null%2C+it+would+cause+the+error%2C+%22Conversion+from+type+%27DBNull%27+to+type+%27String%27+is+not+valid%22.%C2%A0+A+work-around+to+stop+this+error+was+to+create+a+function+that+would+evaluate+the+imported+database+variable+for+a+null+value+as+an+object+then+%5B%26hellip%3B%5D+%3Ca+class%3D%22more-link%22+href%3D%22http%3A%2F%2Fwebpaws.com%2Fblog%2F108%2Fconversion-from-type-dbnull-to-type-string-is-not-valid%2F%22%3E%26darr%3B+Read+the+rest+of+this+entry...%3C%2Fa%3E&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>In a VB.net application, retrieving variables from a database, if the value was null, it would cause the error, &#8220;Conversion from type &#8216;DBNull&#8217; to type &#8216;String&#8217; is not valid&#8221;.  A work-around to stop this error was to create a function that would evaluate the imported database variable for a null value as an object then convert it to a string for use without error in your code.</p>
<p>Here is the VB.net code:</p>
<p><code><br />
<span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">Function</span><span style="font-size: x-small;"> checkNull(</span><span style="color: #0000ff; font-size: x-small;">Byval</span><span style="font-size: x-small;"> variable </span><span style="color: #0000ff; font-size: x-small;">as</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">object</span><span style="font-size: x-small;">) </span><span style="color: #0000ff; font-size: x-small;">as</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">String<br />
</span><span style="color: #0000ff; font-size: x-small;"> If</span><span style="font-size: x-small;"> IsDBNull(varialbe) </span><span style="color: #0000ff; font-size: x-small;">Then<br />
</span><span style="color: #0000ff; font-size: x-small;"> Return</span><span style="font-size: x-small;">(</span><span style="color: #800000; font-size: x-small;">""</span><span style="font-size: x-small;">)<br />
</span><span style="color: #0000ff; font-size: x-small;"> Else<br />
</span><span style="color: #0000ff; font-size: x-small;"> Return</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">(variable)<br />
</span><span style="color: #0000ff; font-size: x-small;"> End</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">If<br />
</span><span style="color: #0000ff; font-size: x-small;">End</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">Function</span></span></span><br />
</code></p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/">Conversion from type &#8216;DBNull&#8217; to type &#8216;String&#8217; is not valid</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div><span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="45" href="http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/"></fb:like></span>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/108/conversion-from-type-dbnull-to-type-string-is-not-valid/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</title>
		<link>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/</link>
		<comments>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 01:11:21 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[ModalPopupExtender]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=4</guid>
		<description><![CDATA[Inside a modalpopupextender panel, you need to add and set the UseSubmitBehavior to false for the OK/Cancel controls to be enabled with postback to behave outside of the ajax control. Example: &#60;asp:LinkButton ID="OkButton" runat="server" Text="Button Text" UseSubmitBehavior="false" PostBackUrl="product.aspx?id=3" /&#62; You can also use OnClick in the button to perform an action outside of ajax with [&#8230;] <a class="more-link" href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/">&#8595; Read the rest of this entry...</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/">Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F4%2Fallow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender%2F&amp;title=Allow+page+redirect+from+an+asp%3Alinkbutton+in+an+Ajax+ModalPopupExtender&amp;summary=Inside+a+modalpopupextender+panel%2C+you+need+to+add+and+set+the+UseSubmitBehavior+to+false+for+the+OK%2FCancel+controls+to+be+enabled+with+postback+to+behave+outside+of+the+ajax+control.%0AExample%3A%0A%0A%26lt%3Basp%3ALinkButton+ID%3D%22OkButton%22+runat%3D%22server%22+Text%3D%22Button+Text%22+UseSubmitBehavior%3D%22false%22+PostBackUrl%3D%22product.aspx%3Fid%3D3%22+%2F%26gt%3B%0A%0AYou+can+also+use+OnClick+in+the+button+to+perform+an+action+outside+of+ajax+with+UseSubmitBehavior%3D%22false%22.+&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p><span style="color: #000000; font-size: small;">Inside a modalpopupextender panel, you need to add and set the UseSubmitBehavior to false for the OK/Cancel controls to be enabled with postback to behave outside of the ajax control.</span></p>
<p><span style="font-size: small; text-decoration: underline;">Example:</span><br />
<code><br />
<span style="color: #000000; font-size: small;">&lt;asp:LinkButton ID="OkButton" runat="server" Text="Button Text" UseSubmitBehavior="false" PostBackUrl="product.aspx?id=3" /&gt;</span><br />
</code></p>
<p><span style="color: #000000; font-size: small;">You can also use OnClick in the button to perform an action outside of ajax with UseSubmitBehavior=&#8221;false&#8221;. </span></p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/">Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div><span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="45" href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/"></fb:like></span>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

